.

Why Perl?

<<

c0nciderate

Newbie
Newbie

Posts: 2

Joined: Mon Jun 01, 2009 6:41 pm

Post Mon Jun 01, 2009 7:23 pm

Why Perl?

Hi guys.

I have study html/php, only the basics and found php very good for webforms. Havent learned php with mysql yet.

I red somewhere that Perl in general is better than php. Can somebody explain why Perl is or should be better then php? Is Perl a stronger language with more/larger terrority/area?

Maybe you learn more about systems too when you learn Perl?

Well, pls help me out.
<<

former33t

Full Member
Full Member

Posts: 226

Joined: Sat Feb 14, 2009 12:33 am

Post Mon Jun 01, 2009 8:01 pm

Re: Why Perl?

As I put in an earlier post, I prefer perl.  I found it relatively easy to prototype applications in Perl and then move to C++ for scalability if needed with minimal changes in structure.

One thing to be aware of is that Perl is not truly OO, it just mimics it (poorly at times).  You probably won't notice it until you do something that is stretching the limits of Perl and if you don't know what OO is now, you won't be hindered by this for years to come.

Some of my coworkers in my latest job have an application framework in Python so I'm having to learn it.  Python apparently has more ready-built libraries (which is why they used it).  Looking at the language, I don't see the same immediate portability to C++.

I've had good response from the user community at perlmonks.org.  Good luck in your programming quest.  Whatever you do, don't try to do PHP in a command line wrapper....
Certifications: CREA, MCSE: Security, CCNA, Security+, other junk
<<

apollo

Full Member
Full Member

Posts: 146

Joined: Fri Apr 04, 2008 7:44 pm

Post Mon Jun 01, 2009 10:22 pm

Re: Why Perl?

I use perl more than most of the other languages because a lot of what I do is dealing with text.  In perl, regular expressions flow freely, and I mostly write scripts that are task specific instead of building applications to do things.  Typically if I'm building applications I will use other languages, but as far as a scripting language that has a short start to completion time, perl seems to really be good.  I don't know if this makes me strange or not, but I also tend to use perl inline on the command line to perform functions ranging from pulling lines out of output via regexs to generating exploit strings. 

For instance, if I'm working on figuring out why a webserver is sending crazy amounts of data, I may want to find the offending IP address to dig further.  I might do something like this:

  Code:
cat /var/log/apache2/access.log | perl -e '%hash = (); while(<>){ if(/^([\d\.]+) .*" 200 (\d+)/) {$hash{$1} += $2}}; foreach $ip (keys(%hash)){ print $hash{$ip} . " : $ip\n"}' | sort -n


This code will print out the amount of data sent and the ip address of the host that sent it.  Certainly not pretty but it is effective and I can customize it inline to get me what I'm looking for, which is rarely the same thing twice.  I could do the same thing in python, but it takes more code and lends itself to actually writing a script to a file.  I tend to use PHP for web apps, because for me it integrates more cleanly into web pages and has a familiar syntax as it is very similar to perl.  I am writing some clients that I want to be truly cross platform, and python is great for that as it is extremely portable and perl is slightly less portable and doesn't lend itself as well to classes. 

This is my opinion, and certainly not hard fact.  Much like the epic vi vs emacs discussion, most people stick to what they are most familiar with and there are many ways to approach most problems. 
CISSP, CSSLP, MCSE+Security, MCTS, CCSP, GPEN, GWAPT, GCWN, NOP, OSCP, Security+
<<

c0nsiderate

Newbie
Newbie

Posts: 2

Joined: Mon Jun 01, 2009 8:00 pm

Post Wed Jun 10, 2009 9:07 pm

Re: Why Perl?

Ty guys.

I bought a book about CGI-programming with Perl and honestly I dont find any bigger difference. Well the syntax is maybe ofc but not so much of thinking and how it works. At least not when it comes to read/print data from forms.

I also looked at the different kind of loops and its almost same there. I guess in CGI (web)- programming Perl and PHP is very alike/equal, isnt it?
<<

shakuni

Jr. Member
Jr. Member

Posts: 80

Joined: Sun Nov 04, 2007 2:24 pm

Post Thu Jul 09, 2009 11:52 am

Re: Why Perl?

@c0nciderate

It depends upon your purpose. If you just wanna process forms and fetch/store data in mysql, go for php.
There is no rule, law or tradition that apply universally... including this one.

Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

.
Powered by phpBB® Forum Software © phpBB Group.
Designed by ST Software