in reply to Hash of arrays generation
The former will make $HoA{$key} an array ref regardless of what it was before.
The latter will cause problems if $HoA{$key} was something other than an arrayref.
Gives: Can't use string ("baz") as an ARRAY ref while "strict refs" in use at test.pl line 6.use strict; use warnings; my %HoA; $HoA{'bar'} = 'baz'; @{$HoA{'foo'}} = (1,2,3); @{$HoA{'bar'}} = (1,2,3);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Hash of arrays generation
by nemesisgus (Acolyte) on Sep 05, 2012 at 00:31 UTC |
In Section
Seekers of Perl Wisdom