in reply to Strict Variables without "my"

You want to declare all your variables with my. Scoping issues are one of the biggest causes of hard to find bugs.
Get into the habit of declaring your variables at the smallest scope possible. See Running a subroutine a certain number of times for a good example of scoping errors caused by not declaring variables. Get in the habit of using lexical (my'ed) variables whenever possible.
For the few global variables that you do need you and use the our keyword to make a package global variable. See chapter 4 of the Camel book for more information
If you find yourself needing to maintain a lot of state information throughout your program you might want to consider using and OO approach. See Damian Conway's "Object Oriented Perl" for a good introduction.

Trust me, scoping seems like an unneccessary pain-in-the-ass now, but soon you will be doing it as second nature (and preaching about it to others).

-pete
"Pain heals. Chicks dig scars. Glory lasts forever."

Replies are listed 'Best First'.
Re^2: Variables
by brusimm (Pilgrim) on Dec 05, 2006 at 18:50 UTC
    I have found that rather than "use warnings"
    you may wish to just use the -w in the command line when testing your script.
    It seems to become more of an acceptable option
    when first starting out and you are still muddling
    through the process.

    I sometimes get so many warnings (I didn't say I was good)
    that I can't see the output through the forest.!

    "A body at rest, is an unstoppable force!"