in reply to Re: Trying to automate some scalar assignments
in thread Trying to automate some scalar assignments
(Caveat: This does not use 'my' variables, but then, the OP didn't say that they were required)my %hash = (a => 1, b => 2, c => 3, d => 4); for (keys %hash) { *$_ = \$hash{$_}; } $hash{c} = "foobar"; print "$c\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Trying to automate some scalar assignments
by davido (Cardinal) on Sep 22, 2011 at 21:05 UTC | |
by rastoboy (Monk) on Sep 23, 2011 at 16:34 UTC |