push @{ $file_hash->{$dir} }, $file_name;
The arrays that $file_name are pushed into will be created automagically by Perl.Then to create the report:
foreach my $file_dir (sort keys %{$file_hash}) { foreach my $file (@{ $file_hash->{$file_dir} }){ print "$counter Directory: $file_dir $file\n"; $counter++; } }
In reply to Re: hash or arrays
by Arunbear
in thread hash or arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |