use strict; use warnings; use Data::Dumper; use vars qw( %hash1 %hash2 ); %hash1 = (a => 1); %hash2 = (b => 2); do_badness(); print "hash1: ", Dumper \%hash1; print "hash2: ", Dumper \%hash2; sub do_badness { local *hash1 = \%hash2; bad_sub(); } sub bad_sub { $hash1{c} = 3; }
In reply to Re: Aliasing one hash to another
by imp
in thread Aliasing one hash to another
by throop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |