in reply to How can I stop relying on a global variable?
So value_for is shared by just those two subs.{ my %value_for; sub set_values { my ( $key, $value ) = shift; $value_for{ $key } = $value; } sub function { # ... my $special_value = $value_for{specialness}; # ... } }
Phil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I stop relying on a global variable?
by Anonymous Monk on Feb 03, 2006 at 19:12 UTC | |
by Fletch (Bishop) on Feb 03, 2006 at 19:28 UTC | |
by Anonymous Monk on Feb 03, 2006 at 19:37 UTC |