Mur has asked for the wisdom of the Perl Monks concerning the following question:
vs.{ my $num = 0; sub count_it { $num++; } sub print_it { print $num, "\n"; } }
Which is "better", under what circumstances?sub count_it { our $num ||= 0; $num++; } sub print_it { our $num ||= 0; print $num, "\n"; }
--
Jeff Boes vox 616.226.9550 ext 24
Database Engineer fax 616.349.9076
Nexcerpt, Inc. http://www.nexcerpt.com
...Nexcerpt...Connecting People With Expertise
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pros/cons of my/our sought
by broquaint (Abbot) on May 14, 2002 at 18:31 UTC | |
|
Re: Pros/cons of my/our sought
by cjf (Parson) on May 14, 2002 at 18:12 UTC | |
|
Re: Pros/cons of my/our sought
by blakem (Monsignor) on May 15, 2002 at 08:00 UTC | |
|
(jeffa) Re: Pros/cons of my/our sought
by jeffa (Bishop) on May 14, 2002 at 19:58 UTC | |
|
Re: Pros/cons of my/our sought
by Anonymous Monk on May 14, 2002 at 18:31 UTC |