PS: Sieh auch perldoc perlsub
A "local" just gives temporary values to global (meaning package) variables. It does not create a local variable. This is known as dynamic scoping. Lexical scoping is done with "my", which works more like C's auto declarations.
Btw., perldoc
ist eine Sache die ich an Perl ganz besonders schätze. Gibt es das in Haskill auch?
MfG