in reply to passing variables to a sub
To get rid of it you could either properly initialize the offending variable or turn the warnings off (get rid of "use warnings" or use a lexical "no warnings").
Apart from that you should not use lexicals in a global way.
When you do
You are referencing (and possibly changing!) variables that are defined somewhere else.sub ownertbl { ( $sortby, $ascdesc, $letter ) = @_;
Instead do it like this:
Now (notice the "my"!) you have variables that are local to the sub.sub ownertbl { my ( $sortby, $ascdesc, $letter ) = @_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing variables to a sub
by ag4ve (Monk) on Oct 16, 2010 at 04:18 UTC |