I prefer
over any of your alternatives above. Now you might wonder how I handle strict. Fact is I don't. I don't have stricture enabled until I have done the assignment to $VERSION and other globals I don't plan to type again.$VERSION = '1.00';
being able to localise access to scary things like globals to just where I need them
Just a clarification. I've seen people declare the same variable twice but one should not do
to avoid access to $foo inside &bar. Use some other scope trick for that if it's needed. One misses a great point of having the declaration if one does it more than once for the same variable.sub foo { our $foo; ... } sub bar { ... } sub baz { our $foo; # BAD! ... }
ihb
See perltoc if you don't know which perldoc to read!
In reply to Re^2: Examples fo Where "our" is really needed
by ihb
in thread Examples fo Where "our" is really needed
by geekondemand
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |