For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > April 2004 > Perl vs PHP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Perl vs PHP
peery@comcast.net

2004-04-22, 10:31 am

Why would one prefer PHP over PERL, or vice, versa? I'm guessing PERL has more functionaltiy and is more robust. What are the technical arguments for one over the other?
JP
Wc -Sx- Jones

2004-04-22, 10:31 am

peery@comcast.net wrote:
> Why would one prefer PHP over PERL, or vice, versa? I'm guessing PERL has more functionaltiy and is more robust. What are the technical arguments for one over the other?
> JP
>


LOL :) And I wanted to avoid this same line as fas as Expect was
concerned.

"PHP is a Server-side HTML-embedded cross-platform scripting langauge"
(that was a quote from Ramus Lerdorf, PHP creator; IIRMYQC.)

I Use both PHP and Perl (I use expect too but that is way OT here.)

Once upon a time there were things that PHP could do that were cludgey
in Perl - this is no longer the case.

However on the reverse, there are MANY things that Perl can do that PHP
cannot easily do.

Perl IMHO is a SysAdmin language and PHP is and more or less always will
be a WEB lanaguage.


PHP supports clearer variable level/depth abstraction (called dynamica
variables), Perl supports more obtuse coding styles.

PHP vars could look like:

$var = "Hello";
$$var = "World";

In reality this has become $hello = "world";

echo "$var ${$var}";


You'll have to read PHP coding books too see why this is the case...

In Perl, we have DualVars:

use strict;
use warnings;
use Scalar::Util "dualvar";

my $ans = dualvar 42, 'The Answer to Life, the Universe, and Everything';
printf("\nas number = '%d', as string = '%s'\n", $ans, $ans);

my $que = dualvar 54, 'What do you get when you multiply 6 by 9';
printf("\nas number = '%d', as string = '%s'\n", $que, $que);

But like I said in the past, each language has its own strengths.

LOL =)
--
_Sx_ http://youve-reached-the.endoftheinternet.org/ _____
http://jaxpm.insecurity.org/
http://cis4dl.insecurity.org/
Ron B

2004-04-22, 10:31 am

Why would one prefer Pepsi over Coke, or vice versa? :) That's the
answer to your question.

peery@comcast.net wrote:
> Why would one prefer PHP over PERL, or vice, versa? I'm guessing PERL has more functionaltiy and is more robust. What are the technical arguments for one over the other?
> JP


Jan Eden

2004-04-22, 11:32 am

Ron B wrote on 22.04.2004:

>Why would one prefer Pepsi over Coke, or vice versa? :) That's the
>answer to your question.
>
>peery@comcast.net wrote:
>


This implies that programming/scripting languages differ not more than soft=
drinks. Interesting. So by knowing (a little) Perl, I can program also Fort=
ran and Cobol! I never knew that. Thanks Ron! ;)

Jan
--=20
The day Microsoft makes something that doesn't suck is the day they start s=
elling vacuum cleaners.
U235sentinel

2004-04-22, 11:32 am

hehehe... You might be surprised.

While IANACY (I an not a coder... yet!), I have dabbled with other
languages. The last 6+ months I've been studying Perl programming
intending to push into coding. I've seen code in other languages (C for
example) and much of it looks very similar to Perl. If I didn't look
closer I would have mistakenly said it was Perl code ::grinz::

Even though languages are very different in what they can do, they have
many similarities.



Jan Eden wrote:

>Ron B wrote on 22.04.2004:
>
>
>
>
>This implies that programming/scripting languages differ not more than softdrinks. Interesting. So by knowing (a little) Perl, I can program also Fortran and Cobol! I never knew that. Thanks Ron! ;)
>
>Jan
>
>


Wc -Sx- Jones

2004-04-22, 11:32 am

Jan Eden wrote:
> This implies that programming/scripting languages differ not more than softdrinks. Interesting. So by knowing (a little) Perl, I can program also Fortran and Cobol! I never knew that. Thanks Ron! ;)



I can say from personal expereince that if you can program in
Perl you can *definitely* program in COBOL ;)

they are no more different than a keg of flat versus
a can of mountain dew.

quantity over quality
--
_Sx_ http://youve-reached-the.endoftheinternet.org/ _____
http://jaxpm.insecurity.org/
http://cis4dl.insecurity.org/
Wiggins D Anconia

2004-04-22, 12:33 pm

> peery@comcast.net wrote:
PERL has more functionaltiy and is more robust. What are the technical
arguments for one over the other?[color=darkred]
>


>
> Perl IMHO is a SysAdmin language and PHP is and more or less always will
> be a WEB lanaguage.
>


PLEASE, do not pigeon hole Perl like that, you should know better!

Calling Perl a systems language maybe, but not a SysAdmin language, Perl
programmers everywhere are "rolling over in their graves and they aren't
even dead yet" (Andrew Dice Clay, yeh I know, so shoot me, I watch a lot
of movies)....

Helping sys admins with their mundane tasks more robustly than plain
shell, Perl does very well, but its abilities certainly go well beyond
these types of tasks.

http://danconia.org
Jupiterhost.Net

2004-04-22, 12:33 pm



peery@comcast.net wrote:

> That's what I was looking for, thanks!
> Jason
>


No problem! Lots of good info out there :)

>
>
>
>
>
>
>

Jupiterhost.Net

2004-04-22, 12:33 pm



peery@comcast.net wrote:

> Why would one prefer PHP over PERL, or vice, versa?


Both are powerful, Perl is more mature is much more flexible.
PHP is a bloated resource hog also (Any program can be if badly written)
but PHP increases dramatically Apache's footprint and memory usage to
get its "features".

> I'm guessing PERL has more functionaltiy and is more robust.


Yes

> What are the technical arguments for one over the other?


As a server admin and support manager, 95% of our "script" related
problems are with PHP and "Perl" issues are usually just a permission
issue...

PHP is run as a compiled apache module which makes it a trifle faster to
run natively, but I don't feel that it is a big advantage. If I really
need the extra 10ms I'll use mod_perl or PersistentPerl to accomplish
the same thing, only cheaper, faster, and with Perl :)

> JP


I'm sure others will have some info also, but generally I only use PHP
if there is a premade system, like phpBB, that does what I need and is
provided with the host (IE think cPanel) (and only after ruling out an
existing Perl version ;p). Anything I am responsible for making sure is
working well and doing its job I create in Perl...

Just my .02

Lee.M - JupiterHost.Net
Jupiterhost.Net

2004-04-22, 12:33 pm



Wiggins d Anconia wrote:

>
> PERL has more functionaltiy and is more robust. What are the technical
> arguments for one over the other?
>
>
>
>
> PLEASE, do not pigeon hole Perl like that, you should know better!
>
> Calling Perl a systems language maybe, but not a SysAdmin language, Perl
> programmers everywhere are "rolling over in their graves and they aren't
> even dead yet" (Andrew Dice Clay, yeh I know, so shoot me, I watch a lot
> of movies)....
>
> Helping sys admins with their mundane tasks more robustly than plain
> shell, Perl does very well, but its abilities certainly go well beyond
> these types of tasks.


I'll second that emotion :)

>
> http://danconia.org
>

Wc Jones

2004-04-22, 1:31 pm

> > Perl IMHO is a SysAdmin language and PHP is and more or less always will
>
> PLEASE, do not pigeon hole Perl like that, you should know better!


PHP isn't only a web scripting language anymore either.

Things progress ... the future is upon us.

-Sx- :)

Wiggins D Anconia

2004-04-22, 1:31 pm

> > > Perl IMHO is a SysAdmin language and PHP is and more or less
always will
>
> PHP isn't only a web scripting language anymore either.
>
> Things progress ... the future is upon us.
>


True, but I have less desire to advocate PHP, so just left it off
completely...

http://danconia.org
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com