in reply to Perl High School
A few comments to keep you on your toes:
I would also look at fun stuff early on - eg, grab a web page and parse some information from it:if ('four' gt 'five'){ print "four is greater than five\n"; }
Just a personal preference, but I prefer to use CGI in OO way, because for me the code is easier to read, eg:#!/usr/bin/perl -w use strict; use LWP::Simple; my $page = get('http://www.google.com'); # regex to extract certain text etc...
#!/usr/bin/perl -w use strict; use CGI; my $q = new CGI; print $q->header, $q->start_html, $q->table( $q->Tr( $q->th( 'This is a table header', ), $q->td( 'This is a table cell', ), ), ), $q->end_html; exit(0);
For me, $q is short for $query (but I don't just use it for forms these days...)
That way, you can 'hide' the details of namespaces and exporting a little longer. Or at least avoid issues when they use two modules that export subs with the same names to the main script (ack, I'm getting ham-handed in explaining this, sorry).
I see you have the SAMS book, but I'd suggest you also read "Learning Perl" (the 'Llama').
Something I don't see is an explanation of the line:
#!/usr/bin/perl
but perhaps I missed it...
Oh, and on the subject of first line, I think the -w is ignored under windows (someone, please correct me if I'm wrong here) and you should use "use warnings;" instead.
That's all for now. Perhaps when you have more up, you could ask the monastery to take a look - after all, the last thing we want is for a bunch of little brats coming here to come here and ask us questions when you get paid to do it* ;-)
good luck
cLive ;-)
* - err, that's meant to be humorous - sometimes I have to be explicit because people miss the wink...
--
seek(JOB,$$LA,0);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (cLive ;-) Re: Perl High School
by davorg (Chancellor) on Feb 22, 2002 at 07:18 UTC | |
by dws (Chancellor) on Feb 22, 2002 at 07:31 UTC | |
by dragonchild (Archbishop) on Feb 22, 2002 at 14:00 UTC | |
by tilly (Archbishop) on Feb 22, 2002 at 23:21 UTC | |
by dws (Chancellor) on Feb 22, 2002 at 17:53 UTC | |
by dragonchild (Archbishop) on Feb 22, 2002 at 18:08 UTC | |
| |
by cLive ;-) (Prior) on Feb 22, 2002 at 07:22 UTC | |
by davorg (Chancellor) on Feb 22, 2002 at 07:28 UTC | |
by quikwit (Beadle) on Feb 22, 2002 at 14:12 UTC | |
Re: (cLive ;-) Re: Perl High School
by hsweet (Pilgrim) on Feb 23, 2002 at 01:42 UTC | |
Re: (cLive ;-) Re: Perl High School
by hsweet (Pilgrim) on Feb 23, 2002 at 02:54 UTC |