« Lost Boy Scout found in Utah wilderness | Main | Coolest remote-control toy ever »

June 22, 2005

Learning Perl

I decided to lear Perl. I'm tired of staring at Perl scripts and wondering what they do. Larry Wall, the NASA rocket scientist that invented this cryptic language, should be carted off to Gitmo to have bamboo shoots driven under his fingernails. But, be that as it may, I've resigned myself to learn it. So far, I like this Perl tutorial. It's for beginners and that's what I'm after at this point. A simple introduction to a lanugage no sane person would use.

Here's an example of how obtuse the code is. I've been programming for 20 years in BASIC,COBOL,SQR,SQL,SQL,and PeopleCode. I've done some programming in Assembly Langunage(ALC) on a 6809 microprocessor. I took ForTran and Pascal in college. I've NEVER seen anything as bad as this:

In this command, the \n is a carriage return. (Yikes)

print "Hi there!\n";

You can also use special operators like ++, --, +=, -=, /= and *=. These manipulate a scalar's value without needing two elements in an equation. This is incomprehensible gibberish. I've never seen anything remotely like it before. Code should be easy to read and understand, not something you need a Rosetta Stone to decipher.

$a = 5;
$a++; # $a is now 6; we added 1 to it.
$a += 10; # Now it's 16; we added 10.
$a /= 2; # And divided it by 2, so it's 8.


Perl is a horrible, twisted language, tackled with gusto by legions of geeks in the small hours of the morning. It creates absurd, surreal error messages like:

"Unmatched right curly bracket at quiz.pl line 251, at end of line"

Posted by Peenie Wallie on June 22, 2005 at 7:03 PM

Comments

You should check out all the resources at http://learn.perl.org/

In particular, my books "Learning Perl" and "Learning Perl Objects References and Modules" are good introductions, and can be read more quickly if you already are familiar, but at least should be read even if you're an expert!

Posted by: Randal L. Schwartz on June 23, 2005 at 5:24 PM

Thanks for the note. I'll check them out.

Posted by: Peenie Wallie on June 24, 2005 at 9:16 AM

If you've never seen anything that bad, you haven't programmed that much. There are some languages which which you can't even use a common keyboard.

None of the features you point out, however, are special to Perl.

Since you're just started out (or were when you posted this), realize that any new thing is going to seem odd. Don't be too quick to project your feelings onto the language.

Good luck!

Posted by: brian d foy on April 12, 2006 at 9:57 AM

Oh, I've done plenty of programming. Don't you worry about me there, Sparky. I was programming in BASIC when you were still in diapers. I bought my first computer 24 years ago, and I have programmed in BASIC, C, Pascal, Fortran, Assembly Language, COBOL, SQL, SQR, HTML, XML, Perl, PHP, Crystal, Access, PeopleCode, App Engine, Component Interface, and then some. So, don't you worry about me. Having said that, none of these other languages offer the shortcuts that I've seen in Perl, and it is nearly indecipherable. However, I'll give you that any language can be hard to read if you don't know it. ;)

Posted by: Peenie Wallie on April 12, 2006 at 4:16 PM

1987 - Larry Wall falls asleep and hits Larry Wall's forehead on the keyboard. Upon waking Larry Wall decides that the string of characters on Larry Wall's monitor isn't random but an example program in a programming language that God wants His prophet, Larry Wall, to design. Perl is born.

Posted by: History of Programming Languages on May 15, 2009 at 2:34 PM

See Oleg Volk's blog entry on learning Perl.

Posted by: Robert on February 18, 2010 at 6:53 AM

Post a comment




Remember Me?

(you may use HTML tags for style)


NOTICE: IT WILL TAKE APPROX 1-2 MINS FOR YOUR COMMENT TO POST SUCCESSFULLY. YOU WILL HAVE TO REFRESH YOUR BROWSER. PLEASE DO NOT DOUBLE POST COMMENTS OR I WILL KILL YOU.