- or download this
my %h = ();
foreach(@_) {
$h{something} = $_; # changes the %h above every time
push @something, \%h; # puts the %h into @something multiple times
+...
}
- or download this
my %h = ();
foreach(@_) {
$h{something} = $_; # changes the %h above every time
push @something, {%h}; # copies the accumulated changes into @somet
+hing
}
- or download this
foreach( @_ ) {
my %new_hash = (something => $_ ); # make a new hash
push @something, \%new_hash; # push it onto the stack
}
- or download this
foreach(@_) {
push @something, { something => $_ }; # make a new hash and push i
+t onto @something! Magic!
}