in reply to Re: Examples fo Where "our" is really needed
in thread Examples fo Where "our" is really needed
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Examples fo Where "our" is really needed
by TimToady (Parson) on May 05, 2005 at 17:49 UTC | |
by ihb (Deacon) on May 06, 2005 at 01:24 UTC | |
|
Re^3: Examples fo Where "our" is really needed
by adrianh (Chancellor) on May 05, 2005 at 15:06 UTC |