in reply to Examples fo Where "our" is really needed
I seek some example to meditate upon in which the "our" syntax really helps improve the performance or readability of the code. Pray tell me what those examples might be!
Two (small) advantages for me.
First it allows me to type less and still have clarity. For example I prefer this
our $VERSION = '1.00';
to this
use vars qw( $VERSION ); .... $VERSION = '1.00';
or this
$SomePackage::VERSION = '1.00';
Secondly I like being able to localise access to scary things like globals to just where I need them so I can do things like this:
sub AUTOLOAD { our $AUTOLOAD; .... };
I admit these are small advantages, and some would say too small to drop backward compatability, but I like them and will quite happily continue to use our :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Examples fo Where "our" is really needed
by ihb (Deacon) on May 05, 2005 at 14:50 UTC | |
by TimToady (Parson) on May 05, 2005 at 17:49 UTC | |
by ihb (Deacon) on May 06, 2005 at 01:24 UTC | |
by adrianh (Chancellor) on May 05, 2005 at 15:06 UTC |