• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

php vs perl in web pages

stndn

Golden Member
Hi all.

I'm just wondering, what is the major differences between Perl and PHP when it comes to using them in webpages?

Basically what i'm wondering is, what can be done in Perl that can't be done in PHP, and vice versa?
How is one better than the other?
And when it comes to doing dynamic web contents (news, blog, etc), which is preferred between the two?

I wondered about this while i'm working on my project to create my own blog script. I was trying to do it in PHP, but i haven't finished learning the stuffs i *think* will be necessary to implement it in PHP.

On the other hand, i think i might be able to do it in Perl/CGI in short time...

So, what's the advantages of PHP compared to Perl? Disadvantages?

Thanks.
 
PHP is a new language, it's a hell of a lot faster to execute IMO, those are 2 reasons I can think why i prefer PHP to perl.

Try searching google for PHP vs Perl
 
d'oh!
i didn't expect to find so many results .... ><;;

anyways, more support for php compared to perl when it comes to web design, though....
so maybe i should really consider php...
 
IMHO, PHP is a crufty kludge of a language ... I posted a thread on the subject a few months back.

I'm not a big Perl fan either, but I've switched to it for my current project.
 
How about cold fusion? For a "free" version look into newatlanta's Blue dragon (it'll run on Linux or Windows with Apache or IIS and use mySQL, et al as a datasource).

The handfull of times that I've gotten to program something in CFM it has seemed to work so much better and program much quicker than PHP, ASP or Perl...
 
PHP is a new language, it's a hell of a lot faster to execute IMO, those are 2 reasons I can think why i prefer PHP to perl.

Since when is being newer considered a feature? Perl being older is one of it's best features, have you seen all the modules on CPAN? Just about everything you could want to do has a module already written for you.
 
hmmm... didn't expect to see all the pros and cons coming out from both sides ...
personally i like perl myself, since that's where i came from..
but i'd like to get ideas on which one most webmasters prefer..
it seems that more people prefer PHP for it's easier-to-use "feature"

coldfusion looks interesting, but it has the notion of making me learn entirely new language...
since i'm doing this in my spare time, i don't think i have the motivation for that ... at least not now ><;;
 
actually, now that i think about it ...

is making a dynamic website using both perl and php in one page feasible?
or rather ... is it even worth considering?

sounds silly, but who knows......
 
Originally posted by: Nothinman
PHP is a new language, it's a hell of a lot faster to execute IMO, those are 2 reasons I can think why i prefer PHP to perl.

Since when is being newer considered a feature? Perl being older is one of it's best features, have you seen all the modules on CPAN? Just about everything you could want to do has a module already written for you.

My point was that PHP is a newer language that more and more people are interested in therefore it is much easier to find people to help you out with, however perl does as you said, have a LOT more already available, however in my experience some of the much older stuff is hard to get support for.
 
Personally I felt that php was very easy to get into as someone with very little programming knowledge. But once I learned other (less hacky) languages, I grew to hate php. It's not a particularly good programming language IMO. I would personally rather know perl than php. At least perl has more than (basically) a single purpose.
 
Originally posted by: randumb
Originally posted by: BingBongWongFooey
Cold fusion seems to be in a completely different dimension than perl or php.

Because it's proprietary.

Well, that's not really what I meant. Look at the code itself; coldfusion kinda marches to its own drummer. 😛
 
Originally posted by: notfred
Originally posted by: DannyBoy
PHP is ... a hell of a lot faster to execute IMO

It's really not.

If you're using Perl for web work, unless you're using FastCGI or mod_perl, you're going to be forking a new process that restarts a new instance of perl for each request just to run your script. This will scale poorly versus PHP. It would also make it difficult for you to pool your database connections ("persistant DB connections").

The link you pointed to would be valid if you were running PHP in cgi mode and comparing it against Perl's CGI performance.
 
Originally posted by: arcain
Originally posted by: notfred
Originally posted by: DannyBoy
PHP is ... a hell of a lot faster to execute IMO

It's really not.

If you're using Perl for web work, unless you're using FastCGI or mod_perl, you're going to be forking a new process that restarts a new instance of perl for each request just to run your script. This will scale poorly versus PHP. It would also make it difficult for you to pool your database connections ("persistant DB connections").

The link you pointed to would be valid if you were running PHP in cgi mode and comparing it against Perl's CGI performance.


Why wouldn't you use mod_perl? and with Apache:: DBI, persistant DB connections are completely transparent.
 
Originally posted by: randumb
Originally posted by: BingBongWongFooey
Cold fusion seems to be in a completely different dimension than perl or php.

Because it's proprietary.
I dont know a lot about cold fusion but I dont think this is the case. I'm pretty sure all the cold fusion engine does is take the cf tags and replace them with jsp code and than run the page by its jrun engine.

This of course is just what I think I've heard and I could be wrong...
 
Originally posted by: spyordie007
Originally posted by: randumb
Originally posted by: BingBongWongFooey
Cold fusion seems to be in a completely different dimension than perl or php.

Because it's proprietary.
I dont know a lot about cold fusion but I dont think this is the case. I'm pretty sure all the cold fusion engine does is take the cf tags and replace them with jsp code and than run the page by its jrun engine.

This of course is just what I think I've heard and I could be wrong...

And how does any of that conflict with being proprietary?
 
i made a thread like this some ages ago i think, and the general responses at the time indicated that Perl has more uses outside of dynamic web pages, while PHP has native support for mySQL, and a few other things. Syntax-wise, both are of equal simplicity to learn. there are a lot of sites using each. for me i went with php because it was easier to learn.
 
I do enjoy perl coding more than I do PHP but this is just my preference. However, sometimes perl can be a b*tch to extend with the modules that are available. I just recently had a problem where I was trying to install the GD graphics library with the appropriate supporting modules (libpng, etc.) and had a hell of a time getting it to work. In fact it never would compile in CPAN. Probably a problem with the compiler but nevertheless it was a pain. I finally just used a flash file to read the data and display the graph. I just wish there was a well laid out package selection program that offered precompiled binaries for all platforms perl will run on.
 
stndn, this question is very hard to answer, and it really depends on your preferences, and programming goal.

I would say that for web-design, I would choose PHP over PERL any day of the week. PHP has native support for so many different database engines, and is created with the purpose of being a client-side programming language. PERL on the other hand is a UNIX language which is designed for creating console programs (i think... not exactly sure) PERL has many more uses, such as creating network applications, and other types of programs...

One of the quirks that I hate about PERL, is that you need a separate subroutine to parse the input of a page... PHP on the other hand, simple creates variables for each of your input fields.

ex. if you have a text field named "password", PHP creates a variable called $password, and the text entered in the box would be its value...

I've noticed that PHP has a module called PHP-GTK which allows you to create windows forms with PHP, but you would still need the PHP interpreter to run the programs... If you need to create windows programs though, you're not likely to choose an inrepreted language over a compiled language...
 
Back
Top