Hi
The value of a hash key can only be a reference to an array, not an array itself. So: instead of:
# not $hierarchy{$directory} = (); # but $hierarchy{$directory} = []; # later, not push($hierarchy{$directory}, $filename); # but push(@{ $hierarchy{$directory} }, $filename);
perldoc perlref is your friend
HTH
ViceRaid
In reply to Re: Forcing Array Context
by ViceRaid
in thread Forcing Array Context
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |