Perl/PHP

Questions about programming languages and debugging
Post Reply
User avatar
jneaod
On the way to fame!
On the way to fame!
Posts: 49
Joined: 11 Feb 2006, 17:00
18

Perl/PHP

Post by jneaod »

Which one should i learn. Please tell me about each of them and the pros and cons of both. And also thier uses. Thanks. I am going to go to the websites and look for info aswell.

d10b
Fame ! Where are the chicks?!
Fame ! Where are the chicks?!
Posts: 159
Joined: 05 Nov 2005, 17:00
18
Location: Saint Paul, MN
Contact:

Yikes

Post by d10b »

PHP actually comes from Perl. :) But I guess this all depends if you know any programming languages at all... Because, often said, if you have knowledge of one language it makes others easier to understand because it's just the syntax that changes. Basic principles are still the same.

The real question is why do you need to learn either of these languages and which one fits that task bettah?! :)

http://en.wikipedia.org/wiki/Perl

http://en.wikipedia.org/wiki/PHP
``The true voyage of discovery lies not in seeking new landscapes, but in having new eyes``

User avatar
FrankB
Ph. D. in Sucko'logics
Ph. D. in Sucko'logics
Posts: 315
Joined: 06 Mar 2006, 17:00
18
Location: Belgistahn
Contact:

Perl or PHP

Post by FrankB »

Saying "Perl or PHP?" is not an option.
No.
Sorry.

PHP may have alledgelly emerged from Perl but it are really two different languages because their goals in the beginning were totally different.

PHP behavior can be invoked running the follow command on your shell:

Code: Select all

 /usr/bin/perl -MCGI
It calls the Perl buitin CGI.pm (module) and there is where PHP took it over being a fully qualified server scripting language with home made classes and builtin classes which make it a OOprogramming language.

In other words : what was done on the CGI side of Perl has now become PHP in a more or less secure way : server-side scripting.

Perl, per definition is not an OOriented language, it goes somehow, directly to a module-interface-language when needed because `Objects' in Perl are based on innate recursive small datatypes, which makes it kind of unique like Python.

Perl, per definition is a Practical Extracting and Reporting Language that does anything but just anything you ever dreamt of with text, images and databases.

Perl developers have now their own dialect and has nothing to do with the current PHP. The syntax may look the same but the datatypes / constants and globs are really NOT the same, really!

In fact, you should learn both and probably more PHP than Perl because using Perl in your daily life is a seldom thing, unless you regularily monitor massive files and directories on a UNIX system with 'grep', 'cat','sed','fork' 'awk' 'tr' to sort enormous files of comma separated values, parse XML, RSS, manage CVS or scan enormous LOG files or txt files on a daily basis.

Perl is parsing text & form processing in a `quick & dirty' way. Which contributed to its prefered misschief hacker / cracker tool to fool CGI directories and DBI systems.
Countless "cgi-bin" directories have been defaced, hacked and cracked with Perl.

We see the same thing happening with PHP modules or prebuilt functions applied on 'free-software'.

PHP on the other hand is more suitable for Web applications, look at it as ASP.NET without privilges to the Windows Core while Perl would be more somethig like vb.NET with privileges to the core of Windows.

Pro & Contra.

I learned both and i must say : PHP is excellent with MySQL my preffered database administration tool.
Perl got a little out-schooled when it deals with database administration in Windows environment.

Perl remains my favorite for raw-or developped applications for the Web, you can create highly portable things with Perl like a SMS (cellphone to web) applictions in a few lines because Perl is smoothly adjacent to proggies written in C, C++ that will adopt and convert the perlscript quie easy (see :: www.cpan.org for details ).
Perl is an tremendous 'parser','filter' and to me, the best applicable REGEX tool which i use a lot.

I think, depending on your needs, feel free to post them, you should learn PHP first though !
Because learning Perl just for learning.. well, you might get discouraged or disappointed for a while. It neds time and experience to have your first perlscripts to do some awsome stuff, while with PHP, you can already do all that sever-side handling right from the start (that'w why it was made for anyway).

--
FrankB

User avatar
jneaod
On the way to fame!
On the way to fame!
Posts: 49
Joined: 11 Feb 2006, 17:00
18

Post by jneaod »

The intro page for perl on wiki.com says it is able to produce gui and stuff. Anyways can perl write filesystems for operating systems?

User avatar
f0rg3
Newbie
Newbie
Posts: 2
Joined: 17 Sep 2006, 16:00
17

Thanks Frank

Post by f0rg3 »

thanks i enjoyed reading this little write up thanks for the wiki links also

Post Reply