Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 05-21-2008, 02:54 PM   #1
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
PHP vs Perl

I am becoming extremely frustrated with the limitations of the PHP language and would like to program in something else that has more power. I'd prefer Ruby but I need to be able to deploy it to people's servers and ruby is a bit difficult to deploy for the average webmaster. So I was thinking Perl might be a good choice since it a lot more common.

How common is it to have Perl run out of the box on most servers? Can the average webmaster set it up if he needs to? Is there any way to protect the code like IonCube or ZendGuard?

It so frustrating being forced to use PHP all the time. I want something better but need to be able to work with everyone else in the community.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 02:58 PM   #2
ScriptWorkz
Confirmed User
 
Industry Role:
Join Date: Jul 2007
Location: Intraweb
Posts: 274
What kinda stuff are you so frustrated about not being able to do in php? As far as web based stuff goes, i'd honestly say php is your best bet (i program in perl, php, ruby, etc..)
ScriptWorkz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 02:59 PM   #3
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Ever consider Python ?
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 03:26 PM   #4
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
PHP scoping is probably the most annoying. Having to do global $myVar all the time.
$ and -> really make the code ugly. I prefer . to ->.

$this-> is retarded. If it's not a local variable then it should check further up the scope to see if it's a class variable, or like ruby you can use @ or @@ to specify scope.

Why do I need to stick a $ in front of all variables? That's just pure laziness of the language designer not wanting to complicate the parser and forcing that burden onto the coder. If it's not already in the symbol table or it's not any language grammar then it must be a variable. Duh.

Sometimes you have to store something in a variable before you can access it as an array. You can't do gimmeaArray()[0]. You have to do:

$tempVar = gimmeArray();
echo $tempVar[0];

Functions are second-rate citizens in PHP. They can't be stored in variables and can't be passed as parameters.

It's just a pain to do a lot of things.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 03:30 PM   #5
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
there is nothing you listed there that can't be easily worked around.
$tempVar = gimmeArray();
echo $tempVar[0];

are you really complaining about a single extra line of code here??

If you are worried about variable scoping, store your shit in the superglobals so you dont have to do that.
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 03:34 PM   #6
farkedup
Confirmed User
 
Join Date: Nov 2007
Location: Kalamazoo, MI
Posts: 2,490
Here's what it comes down to for the most part. if you're NOT trying to build something that needs to handle mass amounts of traffic perl is GREAT, using it to build data is pretty usefull and it DOES have a DBI so you can even put that data into the DB.

When it comes down to being able to serve thousands to hundreds of thousands of pages a day that is where perl becomes a limp dick at an orgy... useless and out of place.

Perl is more of a server maintanence type language. I would worry about learning ruby before bothering going BACK to perl. Perl is something I used a LOT 10 years ago but everything else has moved on and perl hasn't really.
__________________
-- QUOTE ME IT MAKES ME FEEL SPECIAL --
farkedup is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 03:38 PM   #7
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
i really don't like php either but ...

Quote:
Originally Posted by brandonstills View Post
PHP scoping is probably the most annoying. Having to do global $myVar all the time.
$ and -> really make the code ugly. I prefer . to ->.

$this-> is retarded. If it's not a local variable then it should check further up the scope to see if it's a class variable, or like ruby you can use @ or @@ to specify scope.

Why do I need to stick a $ in front of all variables? That's just pure laziness of the language designer not wanting to complicate the parser and forcing that burden onto the coder. If it's not already in the symbol table or it's not any language grammar then it must be a variable. Duh.

Sometimes you have to store something in a variable before you can access it as an array. You can't do gimmeaArray()[0]. You have to do:

$tempVar = gimmeArray();
echo $tempVar[0];

Functions are second-rate citizens in PHP. They can't be stored in variables and can't be passed as parameters.

It's just a pain to do a lot of things.
$this-> ... is retarded? ... so OOP is wasting your time?
"Why do I need to stick a $ in front of all variables?" ... perl is not much different

"Functions are second-rate citizens in PHP" ? ... huh?

"It's just a pain to do a lot of things." ... sounds like you're just having a bad day and you're just working harder and not smarter ... Welcome to the wonderful world of programming.
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 03:58 PM   #8
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by brandonstills View Post
PHP scoping is probably the most annoying. Having to do global $myVar all the time.
$ and -> really make the code ugly. I prefer . to ->.

$this-> is retarded. If it's not a local variable then it should check further up the scope to see if it's a class variable, or like ruby you can use @ or @@ to specify scope.

Why do I need to stick a $ in front of all variables? That's just pure laziness of the language designer not wanting to complicate the parser and forcing that burden onto the coder. If it's not already in the symbol table or it's not any language grammar then it must be a variable. Duh.

Sometimes you have to store something in a variable before you can access it as an array. You can't do gimmeaArray()[0]. You have to do:

$tempVar = gimmeArray();
echo $tempVar[0];

Functions are second-rate citizens in PHP. They can't be stored in variables and can't be passed as parameters.

It's just a pain to do a lot of things.
Each language has its faults. No offense, but I think you're just being lazy. PHP doesn't enforce any type of standards, it actually encourages laziness, but if used right, with appropriate design patterns, it can be quite powerful.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 03:58 PM   #9
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
Quote:
Originally Posted by fartfly View Post
$this-> ... is retarded? ... so OOP is wasting your time?
Incorrect. The syntax is cumbersome. I'm not talking about OOP. There's no reason why you can't just use the variable name. If it's not local $this-> should be implied.

Quote:
"Why do I need to stick a $ in front of all variables?" ... perl is not much different
This is true. But Perl is the only other language that seems like it has a common install base. Something I'll deal with if Perl is indeed the best option. Every language has it quirks and annoyances. Some more than others.

Quote:
"Functions are second-rate citizens in PHP" ? ... huh?
Study lambda calculus, LISP, Ruby or any functional language. You will have a better idea of what this means.


Quote:
"It's just a pain to do a lot of things." ... sounds like you're just having a bad day and you're just working harder and not smarter ... Welcome to the wonderful world of programming.
Incorrect. Some languages are more powerful to use than others. Just like assembly takes more effort that a higher level language can do much easier. PHP is a very limited language in what it allows you to do. Sure, it's Turing complete so that means you can technically do anything, but that's not the point. It's about the amount of effort that needs to be expended. You can spend 10 hours doing something that may only take an hour in another language. Also, some things might be able to be dynamic, while PHP only lets you do them statically.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:00 PM   #10
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
What about Python?
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:02 PM   #11
baddog
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: the beach, SoCal
Posts: 107,089
PERL has a ton of modules as I recall, and most likely will not come installed out of the box.

Main problem with PERL is finding someone to work on it when troubles arise.
baddog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:08 PM   #12
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
I.. The.. buh..

I also am lazy and wish it was 1995 again; however, that's not built into my business model.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:08 PM   #13
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
Quote:
Originally Posted by Brujah View Post
What about Python?
I've heard good things about Python. Looked at it briefly years ago. How is it on the deployment end though? If I give a client some Python code will he be able to run it on his server. I have to deal with the godaddy hosted accounts sometimes.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:09 PM   #14
Tempest
Too lazy to set a custom title
 
Industry Role:
Join Date: May 2004
Location: West Coast, Canada.
Posts: 10,217
ha ha ha ha ha.. god.. yes.. perl will let you be a lazy programmer... but if you have problems with the way php handles variables you're going to just love perl and all the additional confusion it can lead to if you don't know what you're doing...

I use php for webpage stuff and perl for server cron tasks, large text file work etc. I don't think there's any way to encrypt perl but I haven't looked into that for years now.

I've never seen perl NOT come installed on a server.. but there's so many modules for things available that if you want something special, it might need to be installed.
Tempest is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:10 PM   #15
ScriptWorkz
Confirmed User
 
Industry Role:
Join Date: Jul 2007
Location: Intraweb
Posts: 274
I don't really feel like getting into a debate and trying to argue over how php should be, but i will say this, i don't think it's so much that php can't do what you want, or it's limited (and i do feel it's whack for you to hate php cuz your too lazy to use $ and $this, etc..), but it's more a matter of you not accepting the fact it's not LISP, or ruby, etc.. it's PHP, if you use it like it's intended, it's an EXTREMELY powerful and flexible language (especially as far as script goes), and i do wish we could use the return values straight from the function calls, ala getArray()[0], but that's hardly a reason to condemn any language.

In response to your original question tho, i doubt you'd like perl too much and as others have said, the day of perl and high traffic websites are pretty much over. I'd say stick w/ ruby (and rails), or maybe pick up python, you might like the way it is over php and it's a pretty righteous language in itself.

Just saw the question of the deployment of python. I doubt python support in web servers is all that common, if your dealing w/ john q. public on shared hosting, etc.. Your pretty much fucked buddy, get over your fear of the extra typing and embrace php, use it like it's supposed to, love it, and it loves you back

Last edited by ScriptWorkz; 05-21-2008 at 04:12 PM..
ScriptWorkz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:16 PM   #16
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by brandonstills View Post
Incorrect. The syntax is cumbersome. I'm not talking about OOP. There's no reason why you can't just use the variable name. If it's not local $this-> should be implied.
mmmkay... what was I thinking. How could $this-> be anyway related to OOP. my bad.


Quote:
This is true. But Perl is the only other language that seems like it has a common install base. Something I'll deal with if Perl is indeed the best option. Every language has it quirks and annoyances. Some more than others.
so you're annoyed you have to use an $. That really is a pisser


Quote:
Study lambda calculus, LISP, Ruby or any functional language. You will have a better idea of what this means.
no thanks, I did my time in discrete math ... I know what you mean, I just don't agree with you. Ruby is a framework...



Quote:
Incorrect. Some languages are more powerful to use than others. Just like assembly takes more effort that a higher level language can do much easier. PHP is a very limited language in what it allows you to do. Sure, it's Turing complete so that means you can technically do anything, but that's not the point. It's about the amount of effort that needs to be expended. You can spend 10 hours doing something that may only take an hour in another language. Also, some things might be able to be dynamic, while PHP only lets you do them statically.
happy programming
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:16 PM   #17
baddog
So Fucking Banned
 
Industry Role:
Join Date: Apr 2001
Location: the beach, SoCal
Posts: 107,089
Quote:
Originally Posted by Tempest View Post
I've never seen perl NOT come installed on a server.. but there's so many modules for things available that if you want something special, it might need to be installed.
Okay, yeah . . . the base is probably there, getting it to work is something else. One module needs another which needs three more, etc, etc
baddog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:19 PM   #18
d-null
. . .
 
d-null's Avatar
 
Industry Role:
Join Date: Apr 2007
Location: NY
Posts: 13,724
Quote:
Originally Posted by ScriptWorkz View Post
...

In response to your original question tho, i doubt you'd like perl too much and as others have said, the day of perl and high traffic websites are pretty much over. I'd say stick w/ ruby (and rails), .....
quick question here, I've never used ruby or rails but I have been told that it is very resource intensive so it may not be the best choice for high traffic websites? is this true or not?
__________________

__________________

Looking for a custom TUBE SCRIPT that supports massive traffic, load balancing, billing support, and h264 encoding? Hit up Konrad!
Looking for designs for your websites or custom tubesite design? Hit up Zuzana Designs
Check out the #1 WordPress SEO Plugin: CyberSEO Suite
d-null is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:19 PM   #19
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
I'd say stick with PHP, or try a little Python.
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:19 PM   #20
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by fartfly View Post
happy programming
I don't remember what you did to annoy me, but I'm removing you from my "angry face" emoticon set and putting you back on the "bemused and/or ready to vomit" list.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:20 PM   #21
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
Quote:
Originally Posted by fartfly View Post
Ruby is a framework...
Rails is a framework. Ruby is a language.
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:21 PM   #22
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
Quote:
Originally Posted by GrouchyAdmin View Post
I don't remember what you did to annoy me, but I'm removing you from my "angry face" emoticon set and putting you back on the "bemused and/or ready to vomit" list.
im thrilled ... thank you.





















































happy programming ;)
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself

Last edited by 2012; 05-21-2008 at 04:22 PM.. Reason: lol
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:23 PM   #23
ScriptWorkz
Confirmed User
 
Industry Role:
Join Date: Jul 2007
Location: Intraweb
Posts: 274
Quote:
Originally Posted by jetjet View Post
quick question here, I've never used ruby or rails but I have been told that it is very resource intensive so it may not be the best choice for high traffic websites? is this true or not?
To be honest, i made a mistake and might of misled someone, i don't personally have any experience using ruby on rails for high traffic sites, it's nice to program with but for sites that really get hammered we always use php. The only sites i've used ruby on don't get _alot_ of traffic and i'm not really privvy on the resource usage / stats for those sites.
ScriptWorkz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:29 PM   #24
u-Bob
there's no $$$ in porn
 
u-Bob's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: icq: 195./568.-230 (btw: not getting offline msgs)
Posts: 33,063
Quote:
Originally Posted by farkedup View Post
When it comes down to being able to serve thousands to hundreds of thousands of pages a day that is where perl becomes a limp dick at an orgy... useless and out of place.
You are probably referring to perl cgi. PHP has the same 'limp dick' problems if you use it via the traditional cgi way. If you want to compare apples with apples then you have to compare mod_perl with mod_php and perl cgi with php cgi. If you compare mod_perl with mod_php you'll not only notice that mod_perl is faster than mod_php, it's also a lot more powerful. Mod_perl lets you to directly use all of the apache API in perl. PHP (mod_php) only allows you to control the content (response) phase of the Apache server.

When you request a page from an Apache webserver, the request goes through several processing phases (authentication, logging,... the response phase). The response phase is what you work with when building a perl cgi script or a php script. It is the part of the process that generates the actual HTML page and returns it to the browser. Mod_perl gives you the ability to replace the default behaviors of any of these processing phases with your own phase handlers.

Quote:
Originally Posted by farkedup View Post
Perl is more of a server maintanence type language.
Perl is more a do-whatever-you-want-from-webscraping-to-putting-satellites-in-orbit type language.

Quote:
Originally Posted by farkedup View Post
I would worry about learning ruby before bothering going BACK to perl. Perl is something I used a LOT 10 years ago but everything else has moved on and perl hasn't really.

Learning perl is hardly going 'back'. LOL
u-Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:29 PM   #25
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
enjoy

Quote:
Originally Posted by k0nr4d View Post
Rails is a framework. Ruby is a language.
whatever ... "Ruby on Rails" I mean ...
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:30 PM   #26
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
Quote:
Originally Posted by ScriptWorkz View Post
I don't really feel like getting into a debate and trying to argue over how php should be, but i will say this, i don't think it's so much that php can't do what you want, or it's limited (and i do feel it's whack for you to hate php cuz your too lazy to use $ and $this, etc..), but it's more a matter of you not accepting the fact it's not LISP, or ruby, etc.. it's PHP, if you use it like it's intended, it's an EXTREMELY powerful and flexible language (especially as far as script goes), and i do wish we could use the return values straight from the function calls, ala getArray()[0], but that's hardly a reason to condemn any language.

In response to your original question tho, i doubt you'd like perl too much and as others have said, the day of perl and high traffic websites are pretty much over. I'd say stick w/ ruby (and rails), or maybe pick up python, you might like the way it is over php and it's a pretty righteous language in itself.

Just saw the question of the deployment of python. I doubt python support in web servers is all that common, if your dealing w/ john q. public on shared hosting, etc.. Your pretty much fucked buddy, get over your fear of the extra typing and embrace php, use it like it's supposed to, love it, and it loves you back
It's not a matter of laziness in the sense you are describing. It just seems like there is a lot of .... "noise" ... in the language. Lots of symbols and words that don't need to be there. Clutter if you will.

Also, hate might be a bit strong. It's just not the right tool for the job. No matter how I use a screwdriver it's just not going to work as well as a hammer for putting nails in a wall. I could do it with a screwdriver, but it's not ideal. Would require more effort and take longer.

The language feels like a hack of things thrown together without much thought for their implication. When designing any language there is always a trade-off between how much effort it will be to write the parser/compiler and how much effort will be needed on the user's (coder's) end.

Also, I think it is very rare that people will be able to understand what I am talking about because very few people know how to write a parser / compiler and also very few people are familiar with non-mainstream programming techniques such as closures, lambda calculus, and functional programming.

For anyone interested, I suggest reading the book "Programming Language Pragmatics". You will have a much better understanding of the differences between the languages. Sure you can do everything in pretty much every language, but some let you do it a lot easier. Saying that's just being lazy is a poor rebuttal. Wanting to use a hammer when you're forced to use a screwdriver isn't laziness, it's because you know there's something better for that particular task.

Using it like it's intended only works if PHP is suitable to what you are intending to do. I'm not talking about simple scripts. I'm talking about enterprise level stacks and frameworks that can integrate with each other.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:33 PM   #27
ScriptWorkz
Confirmed User
 
Industry Role:
Join Date: Jul 2007
Location: Intraweb
Posts: 274
Quote:
Originally Posted by u-Bob View Post
You are probably referring to perl cgi. PHP has the same 'limp dick' problems if you use it via the traditional cgi way. If you want to compare apples with apples then you have to compare mod_perl with mod_php and perl cgi with php cgi. If you compare mod_perl with mod_php you'll not only notice that mod_perl is faster than mod_php, it's also a lot more powerful. Mod_perl lets you to directly use all of the apache API in perl. PHP (mod_php) only allows you to control the content (response) phase of the Apache server.

When you request a page from an Apache webserver, the request goes through several processing phases (authentication, logging,... the response phase). The response phase is what you work with when building a perl cgi script or a php script. It is the part of the process that generates the actual HTML page and returns it to the browser. Mod_perl gives you the ability to replace the default behaviors of any of these processing phases with your own phase handlers.
mod_perl also allows you to some nifty shit w/ apache configuration (pulling it from outside sources, etc..).

I wish i used perl more, i've forgotten alot about it i'm sure, it just seems like most people use php now. I don't think i've actually wrote any perl (other then maybe fixing someone elses script) in like 2 or 3 years :/

Last edited by ScriptWorkz; 05-21-2008 at 04:34 PM..
ScriptWorkz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:36 PM   #28
u-Bob
there's no $$$ in porn
 
u-Bob's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: icq: 195./568.-230 (btw: not getting offline msgs)
Posts: 33,063
Quote:
Originally Posted by ScriptWorkz View Post
as others have said, the day of perl and high traffic websites are pretty much over.
imdb = powered by mod_perl.
u-Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:37 PM   #29
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
Quote:
Originally Posted by jetjet View Post
quick question here, I've never used ruby or rails but I have been told that it is very resource intensive so it may not be the best choice for high traffic websites? is this true or not?
Ruby on Rails is more resource intensive. In part because it uses a framework, and the other part is that Ruby is not really an optimized language yet. In fact benchmarks show running a Ruby interpreter on top of Java actually runs faster than running the Ruby interpreter directly.

As far as it not being able to be used for high traffic sites is a myth. It can, but it will take up more resources. Usually development costs are more than hosting costs so spending another $100 a month on hosting is better than spending another $10,000 on programming. But it's a choice you need to decide. Things can be developed faster in Ruby on Rails but most small scripts would be better written in PHP because Ruby on Rails is designed to do a specific thing well, if you're not doing that it doesn't help.

Do a google for "can rails scale" and if you want more information.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:39 PM   #30
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by ScriptWorkz View Post
To be honest, i made a mistake and might of misled someone, i don't personally have any experience using ruby on rails for high traffic sites, it's nice to program with but for sites that really get hammered we always use php. The only sites i've used ruby on don't get _alot_ of traffic and i'm not really privvy on the resource usage / stats for those sites.
This all goes back to how you use the tools given to you. Use mod_rails, setup proper caching, whether its page, action, fragment, whatever. Use memcached if you need to. If you are talking about how PHP is "so much faster", then why is it the most commonly crashed site that gets dugg is wordpress

A good language doesn't mean what you write will be great, it just means it has better capabilities.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:41 PM   #31
fluffygrrl
So Fucking Banned
 
Join Date: May 2006
Posts: 2,187
Quote:
Originally Posted by brandonstills View Post
PHP scoping is probably the most annoying. Having to do global $myVar all the time.
$ and -> really make the code ugly. I prefer . to ->.

$this-> is retarded. If it's not a local variable then it should check further up the scope to see if it's a class variable, or like ruby you can use @ or @@ to specify scope.

Why do I need to stick a $ in front of all variables? That's just pure laziness of the language designer not wanting to complicate the parser and forcing that burden onto the coder. If it's not already in the symbol table or it's not any language grammar then it must be a variable. Duh.

Sometimes you have to store something in a variable before you can access it as an array. You can't do gimmeaArray()[0]. You have to do:

$tempVar = gimmeArray();
echo $tempVar[0];
These are the complaints of a painter, not of a coder.

fluffygrrl is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:42 PM   #32
bareskin
Confirmed User
 
bareskin's Avatar
 
Join Date: Nov 2006
Location: Pimpin in socal
Posts: 619
I got a headache after this tthread
__________________
Globat.com hosting company has shitty customer service skills :: please be advised::

Icq# 394599740
bareskin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:42 PM   #33
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by u-Bob View Post
imdb = powered by mod_perl.
Will I rant like you when I get old, Grandpa?

Tons of people use languages because they're familiar, not because they're 'right'. Perl is what you had in the late 90s. It still exists. Should it be used by, oh, say, a bank? Depends on the task. Should it be used to parse XML? Depends on the task; there are many more robust libraries than those written to work with Perl, and if it's for a constant-state application, it should at least be saved in SHM so it can be executed without the disk overhead. Both PHP and Perl can be made to do this.

Will a PHP person browse Google to find a pre-existing solution? Maybe. There's tons of shit that reimplement single functions in PHP with hunderds of kilobytes of code.
Will a Perl person use what they find on CPAN? Fairly likely. It's on CPAN.

Wait, where was I going with this?

Delicious Apple Pie. Something we can all agree upon!
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:42 PM   #34
u-Bob
there's no $$$ in porn
 
u-Bob's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: icq: 195./568.-230 (btw: not getting offline msgs)
Posts: 33,063
Quote:
Originally Posted by ScriptWorkz View Post
it just seems like most people use php now.
True. The reason for this of course has nothing to do speed/reliability/power/... but with the fact that PHP was designed from the ground up with the web in mind and has always been promoted as such... as "thé language to build dynamic websites". So it's more a PR thing
u-Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:43 PM   #35
ScriptWorkz
Confirmed User
 
Industry Role:
Join Date: Jul 2007
Location: Intraweb
Posts: 274
Quote:
Originally Posted by brandonstills View Post
It's not a matter of laziness in the sense you are describing. It just seems like there is a lot of .... "noise" ... in the language. Lots of symbols and words that don't need to be there. Clutter if you will.

Also, hate might be a bit strong. It's just not the right tool for the job. No matter how I use a screwdriver it's just not going to work as well as a hammer for putting nails in a wall. I could do it with a screwdriver, but it's not ideal. Would require more effort and take longer.

The language feels like a hack of things thrown together without much thought for their implication. When designing any language there is always a trade-off between how much effort it will be to write the parser/compiler and how much effort will be needed on the user's (coder's) end.

Also, I think it is very rare that people will be able to understand what I am talking about because very few people know how to write a parser / compiler and also very few people are familiar with non-mainstream programming techniques such as closures, lambda calculus, and functional programming.

For anyone interested, I suggest reading the book "Programming Language Pragmatics". You will have a much better understanding of the differences between the languages. Sure you can do everything in pretty much every language, but some let you do it a lot easier. Saying that's just being lazy is a poor rebuttal. Wanting to use a hammer when you're forced to use a screwdriver isn't laziness, it's because you know there's something better for that particular task.

Using it like it's intended only works if PHP is suitable to what you are intending to do. I'm not talking about simple scripts. I'm talking about enterprise level stacks and frameworks that can integrate with each other.
I agree just using the 'it seems like your lazy' isn't a great rebuttal, but that's what it seems like. You want something that the average joe can run that will do what you need, and that's php. If you really can't bring yourself to use $ for variables, etc.. and think it's that bad of a language, then use something else, but every language has it's reasons for doing things the way they do, you or me may not think something is right, but 99.9% of the way things are the way they are because that's the way it works as fast as it does, or for as many people as it does, etc..

So i guess i'm just saying i agree with you, if php isn't the right tool for the job, it's not. But just because it's 'enterprise level' stuff doesn't mean php isn't that tool. PHP can and is used at an enterprise level and probably is by now the most commonly used scripting language for web based stuff (i don't know if this is true, i haven't looked at the stats for this type of stuff in forever, if it's not #1 it's gotta be damn close).

BTW, most of my experiance does come from programming more mainstream enterprise level stuff, i live, eat, and breathe php code for the most part, and in using it every day for the last 5 or so years i have yet to have any of my clients propose doing something web based that couldn't be done w/ php, and i would say that php accounts for atleast 95% of the programming that i do anymore.

I've written parsing code (script parsing, data mining, and just about any other sort of parsing), as well as compilers, and many enterprise level applications.
ScriptWorkz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:47 PM   #36
Beaver Bob
Confirmed User
 
Beaver Bob's Avatar
 
Join Date: Aug 2005
Location: Las Vegas, NV
Posts: 1,099
Quote:
Originally Posted by brandonstills View Post
PHP scoping is probably the most annoying. Having to do global $myVar all the time.
$ and -> really make the code ugly. I prefer . to ->.
variables in Perl also have the $
__________________
Spunky Dollars | Need Content?
Paysite Owners: Protect Your Members Area with Strongbox

361-574-229
Beaver Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:50 PM   #37
ScriptWorkz
Confirmed User
 
Industry Role:
Join Date: Jul 2007
Location: Intraweb
Posts: 274
Damn 3 minute edit time. Anyways, i'm bad at articulating what i'm thinking sometimes, i'm not hating on any language, it's all about using the right tool for what your doing, and no matter what your writing it in, writing good code. I'm definitley not saying php is the fastest, most reliable, etc.. these are pointless arguments because there are too many factors, i simply prefer it due to the fact it's not a pain in the ass like perl can be, and it's fast / reliable / flexible _enough_ to do what i'm required to do w/ it. I'll use whatever language is right for what i'm doing tho regardless of preference and i'd recommend anyone else doing that too.
ScriptWorkz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:53 PM   #38
u-Bob
there's no $$$ in porn
 
u-Bob's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: icq: 195./568.-230 (btw: not getting offline msgs)
Posts: 33,063
Quote:
Originally Posted by GrouchyAdmin View Post
Tons of people use languages because they're familiar, not because they're 'right'.
I agree. see http://www.gofuckyourself.com/showpo...0&postcount=34


Quote:
Originally Posted by GrouchyAdmin View Post
Perl is what you had in the late 90s. It still exists. Should it be used by, oh, say, a bank? Depends on the task. Should it be used to parse XML? Depends on the task;
FreeBSD and Linux date back to the early 90s. They still exist. Should they be used by, oh, say.... you get my point Just because something has a long history or was popular many years ago, it doesn't mean it's obsolete or hasn't grown/evolved/matured...
u-Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 04:59 PM   #39
mryellow
Confirmed User
 
Industry Role:
Join Date: May 2001
Location: Australia
Posts: 934
Perl is fast, mod_perl etc are as fast if not faster then PHP when properly coded.
Perl is installed everywhere, if you find a *nix box that doesn't have it I'd be surprised.

It's very cool, very awesome at processing text files, nice and flexible regexp native in everything.

Don't under estimate Perl, it really is about the best language out there, just not the
most structured OO/MVC setup in the world.

Compiled C is also pretty cool, tho takes a bit more "noise" as you call it.

-Ben
__________________
Cyberwurx Hosting
After trying 5 different hosts, I found the best.
Since 1997 I've had 2 hours of downtime.
Fast support, great techs, no hype, no gimmicks.

<- I in no way endorse whatever just got stuck on the left of my post.
mryellow is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:03 PM   #40
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
Quote:
Originally Posted by fartfly View Post
mmmkay... what was I thinking. How could $this-> be anyway related to OOP. my bad.

so you're annoyed you have to use an $. That really is a pisser

no thanks, I did my time in discrete math ... I know what you mean, I just don't agree with you. Ruby is a framework...

happy programming
I'm not dissing OOP. Sheesh.

Your statements would indicate you do not "know what I mean" and you are not familiar with the terminology or concepts being discussed here.

Your false statement that "ruby is a framework" indicates you are not well versed in languages and programming in general. Furthermore, saying "no thanks, I did my time with discrete math" is indicative of someone stuck in the ways of ignorance with no desire to change.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:06 PM   #41
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by brandonstills View Post
I'm not dissing OOP. Sheesh.

Your statements would indicate you do not "know what I mean" and you are not familiar with the terminology or concepts being discussed here.

Your false statement that "ruby is a framework" indicates you are not well versed in languages and programming in general. Furthermore, saying "no thanks, I did my time with discrete math" is indicative of someone stuck in the ways of ignorance with no desire to change.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:10 PM   #42
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
Quote:
Originally Posted by ScriptWorkz View Post
To be honest, i made a mistake and might of misled someone, i don't personally have any experience using ruby on rails for high traffic sites, it's nice to program with but for sites that really get hammered we always use php. The only sites i've used ruby on don't get _alot_ of traffic and i'm not really privvy on the resource usage / stats for those sites.
Actually, it should be pointed out that Ruby on Rails (RoR) has an advanced caching system. If it can be served statically without using any language at all it will speed things up. If concerned with performance you may want to look into nginx and memcache as well. Nginx is much more efficient than Apache.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:12 PM   #43
ScriptWorkz
Confirmed User
 
Industry Role:
Join Date: Jul 2007
Location: Intraweb
Posts: 274
Quote:
Originally Posted by brandonstills View Post
Actually, it should be pointed out that Ruby on Rails (RoR) has an advanced caching system. If it can be served statically without using any language at all it will speed things up. If concerned with performance you may want to look into nginx and memcache as well. Nginx is much more efficient than Apache.
It should, i don't know a ton about either RoR or perl anymore, i can program enough to get by in but specialize in php, that's why i admitted i honestly didn't know how it could perform on high traffic sites.

Good thread btw
ScriptWorkz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:16 PM   #44
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
Quote:
Originally Posted by fluffygrrl View Post
These are the complaints of a painter, not of a coder.

It has been said that programmers are closer to artists than most people think. Well, the good ones at least. Management literature has recently started covering this topic.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:19 PM   #45
CyberHustler
Unregistered Abuser
 
Industry Role:
Join Date: Feb 2006
Posts: 25,516
CyberHustler is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:27 PM   #46
mrkris
Confirmed User
 
Join Date: May 2005
Posts: 2,737
Quote:
Originally Posted by ScriptWorkz View Post
It should, i don't know a ton about either RoR or perl anymore, i can program enough to get by in but specialize in php, that's why i admitted i honestly didn't know how it could perform on high traffic sites.

Good thread btw
Working on a Rails app that will be able to support 2mil+ uniques a day. Just have to think about caching layouts and db calls, then you're pretty much set.
__________________

PHP-MySQL-Rails | ICQ: 342500546
mrkris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:36 PM   #47
brandonstills
Confirmed User
 
brandonstills's Avatar
 
Join Date: Dec 2007
Location: Chatsworth, CA
Posts: 1,964
Quote:
Originally Posted by ScriptWorkz View Post
It should, i don't know a ton about either RoR or perl anymore, i can program enough to get by in but specialize in php, that's why i admitted i honestly didn't know how it could perform on high traffic sites.

Good thread btw
I like the way you think and respond ScriptWorkz. I'm not intending this as a bash, I'm just pointing out what I don't like and wanting to find a better solution. So many people would take it as an insult to their favorite programming language and get defensive (as can be seen above). This could have easily escalated into a flame but I think both of us are only interested in exploring the options and learning from each other.

I'm not hating PHP, it's just that after you use other languages and get used to some of what they offer, it's a pain to go back to PHP. Many PHP programmers that learn Ruby feel this way. They don't want to go back because it feels like having to use a horse once you've driven a car.

I've recently been studying compiler design and comparing a lot of different languages. I want to write my own language as an exercise.

Actually, what I would really love to see is for something like Microsoft's dynamic language runtime or Sun's Da Vinci Machine project that can be written in any language and deployed to a server. Too many environments force you to use a language. They are going to compile to bytecode anyways, why not let you write your own bytecode in whatever language you want? The main problem is having a common open-source platform to deploy to.

I've also thought it might be cool to implement a virtual machine inside of PHP so you can run bytecode compiled in other languages. Obviously not ideal for performance, but for backend admin tasks you aren't submitting hundreds of forms per second.
brandonstills is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:48 PM   #48
Sly
Let's do some business!
 
Sly's Avatar
 
Industry Role:
Join Date: Sep 2004
Location: Austin, TX
Posts: 31,297
Watching programmers fight is like watching chicks fight. LOL. Funny stuff.
__________________
Vacares - Web Hosting, Domains, O365, Security & More - Paxum and BTC Accepted

Windows VPS now available - 1st month free for GFY members - DM for details

Wanted: CCBill pay sites for sale
Sly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:53 PM   #49
2012
So Fucking What
 
2012's Avatar
 
Industry Role:
Join Date: Jul 2006
Posts: 17,189
its obvious you know a lot. good luck

Quote:
Originally Posted by brandonstills View Post
I'm not dissing OOP. Sheesh.
didn't say you were ... chillax.

Quote:
Your false statement that "ruby is a framework" indicates you are not well versed in languages and programming in general.
. i know, I don't work with Ruby on rails FRAMEWORK ... I better hang it up.

Quote:
Your statements would indicate you do not "know what I mean"
correct. If you obviously haven't mastered a language, why nitpic the syntax ... congratulations

Quote:
Furthermore, saying "no thanks, I did my time with discrete math" is indicative of someone stuck in the ways of ignorance with no desire to change.
if you say so ...

breath... go for a walk, ... jackoff or something man. It's not that serious ... The most successful programmers are at the golf course. Not hacking code.

Sorry about the misunderstanding, I'll just stick with my vic-20 and leave all the real shit to the professionals
__________________
best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself
2012 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 05-21-2008, 05:53 PM   #50
GrouchyAdmin
Now choke yourself!
 
GrouchyAdmin's Avatar
 
Industry Role:
Join Date: Apr 2006
Posts: 12,085
Quote:
Originally Posted by mrkris View Post
Working on a Rails app that will be able to support 2mil+ uniques a day. Just have to think about caching layouts and db calls, then you're pretty much set.
Well, you'd want to bind nginx to every IP aliased as a separate process, for sure.
__________________
GrouchyAdmin is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.