[Kc] Perl Noob

djgoku djgoku at gmail.com
Wed Sep 19 00:22:17 PDT 2007


On 9/18/07, Eric Wilhelm <scratchcomputing at gmail.com> wrote:
> # from Emmanuel Mejias
> # on Tuesday 18 September 2007 16:35:
>
> Please tell me that book mentions strictures very early.  If not, throw
> it away and read `perldoc perlintro` and the definitive "Programming
> Perl" (possibly "Learning Perl", but really the camel is the way to
> go.)

Learning Perl goes over Pragmas (strict,warnings).

on page 63 (Chapter 4 Subroutines) talks about using 'use strict;'
when writing code.

warnings are pretty early on seems to start on page 24 with 'perl -w script.pl'

> It would also be nice if you did not top-post to the mailing list.

Uh oh, hopefully this doesn't become a problem like KCLUG mailing list. /me runs


> You will then notice that some of those are undefined and thus warn
> about the concatenation.  To deal with that, you'll want to check
> exists($ENV{$key}) or defined($ENV{$key}) -- they are subtly different.
>
> Above all, please use strict and use warnings and declare your variables
> with 'my'.  Learning perl without those three things is altogether
> unpredictable and pretty unpleasant for everyone on the list as well.

I totally agree about using pragmas (strict, warnings) for all programs.


More information about the kc mailing list