perltutorial
root
<B>Number one:</B> when in doubt use <B>perl -w</B>, or replace <B>#!/usr/bin/perl</B> with <B>#!/usr/bin/perl -w</B> this will give you all kinds of helpful diagnostics
when things don't seem to be happening as you'd expect them to.
<BR><BR>
<B>Number two:</B> use <B>use strict;</B> just toss that in at the top of your program and it will force you
to declare your variables before you use them. To declare them all you have to do is something like the
following:<BR>
<PRE>
my $stuff;
my @array;
my %hash;
my ($count,$max,$min,$avg); #this initializes several scalars at once
</PRE>
This can save you countless hours later if you've mistyped a variable name. You'll know about it.