in reply to Array reference of hash references
Initialize an array with parens (or not at all), *not* with square brackets.
Also, declare @official outside the while loop. Otherwise, you are re-initializing it on each loop.perl -MData::Dumper -wle 'my @official = []; print Dumper \@official;' $VAR1 = [ [] ]; perl -MData::Dumper -wle 'my @official = (); print Dumper \@official;' $VAR1 = [];
|
---|
In Section
Seekers of Perl Wisdom