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
In reply to Re: How can I stop relying on a global variable?
by philcrow
in thread How can I stop relying on a global variable?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |