in reply to Several stupid questions about subs

1) local was an old implementation for trying to scope variables, not in favor anymore (can cause unexpected behavior if you pass through nested subroutine calls due to the way it temporarily replaces variable)

2) use my to scope all variables; limit scope to smallest practical enclosing block

3)

use strict; use warnings;
in all scripts

4) Get a copy of "The Camel" (Programming Perl, 3e); if you're completely new to programming you may find Learning Perl helpful too.

5) There is a return statement, see references in #4

-Greg