Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rjbs (4671)

rjbs
  (email not shown publicly)
http://rjbs.manxome.org/
AOL IM: RicardoJBSignes (Add Buddy, Send Message)
Yahoo! ID: RicardoSignes (Add User, Send Message)

I'm a Perl coder living in Bethlehem, PA and working Philadelphia. I'm a philosopher and theologan by training, but I was shocked to learn upon my graduation that these skills don't have many associated careers. Now I write code.

Journal of rjbs (4671)

Monday October 08, 2007
09:08 PM

yet another wretched perl tutorial

[ #34634 ]

Sorry, I mean "PERL tutorial." I guess there are so many of these that it's like shooting fish in a barrel, but I found yet another one today while looking for some JavaScript docs. Seriously, why isn't there a really good installable JS reference yet?

Anyway, some highlights:

Scalars are very straight forward. Notice that we used a period (.) between
each of our variables. This is a special kind of operator that temporarily
appends one string to another.

In case you were wondering:

&& is for numbers, and is for strings

I generally start with, ready?? okay!!:

The first line of every PERL script is a commented line directed
toward the PERL interpreter.

What sigil do I need for URL variables?

Files with special characters or unusual names are best opened by first
declaring the URL as a variable. This method removes any confusion that might
occur as PERL tries to interpret the code.  Tildas in filenames however
require a brief character substitution step before they can be placed into
your open statements.

I'm glad I don't have to deal with CHMOD values myself.

With sysopen you may also set hexidecimal priviledges; CHMOD values. Sysopen
also requires the declaration of a new module for PERL. We will be using the
Fcntl module for now, more on this later. Below we have created a basic HTML
(myhtml.html) file.

Perl tracks the first line you print, apparently:

We have to introduce some HTTP headers so that PERL understands we are
working with a web browser.

It's more precise not to pass in a list, I guess. Maybe it saves us from checking return values:

foreach $file (@files) {
  unlink($file);
}

My favorite, though, was the "qw operator." You know. It produces a list.

Oh, and of course nothing uses strict.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.