Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
DIR FILE_NAME | 954 | 24088954 | | 955 | 24052955 | | 955 | 24111955 | | 955 | 24130955 | | 956 | 23159956 | | 957 | 24133957 | | 958 | 24131958 | | 960 | 24093960 | | 961 | 24033961 | | 961 | 24129961 | | 961 | 24130961 |
$file_hash->{$dir}{push(@file_array,$file_name)};
As you can see, the second record here doesn't belong (the last three digits of the file name correspond to the directory).foreach my $file_dir (sort (keys % {$file_hash})) { foreach my $file (@file_array){ print "$counter Directory: $file_dir $file\n"; $counter++; + } + } 1 Directory: 000 24090000 2 Directory: 000 24125002 3 Directory: 000 24011003 4 Directory: 000 24070003 5 Directory: 000 24082003 6 Directory: 000 24065005 7 Directory: 000 24070007 8 Directory: 000 24132007 9 Directory: 000 24041008
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash or arrays
by cLive ;-) (Prior) on Oct 03, 2004 at 19:28 UTC | |
by Anonymous Monk on Oct 03, 2004 at 19:47 UTC | |
|
Re: hash or arrays
by Arunbear (Prior) on Oct 03, 2004 at 19:27 UTC |