I have set up an associative array to store the contents of two different sets of files so that I can eventually sort the contents depending upon a common factor. When I output to the screen using the following lines of code:
print ($hits{'values'}, "\n"
print ($hits{'files'}, "\n" );
this gives the output:
...
ABS.45354
23442
ABS.45354
23875
ABS.45353
245764
ABT.3133
198
ABT.3133
223 ... and so on for all files in a directoy.
Note that the ABS.45353 is the filename which is the common factor. However my problem is how to output to a file every array element associated with ABS.45353 so that I end up with a sorted file containing a list of the numbers associated with each corresponding file:
e.g: files ABS.45353 containing:
23442
23875
245674
e.g: file ABT.3133 containing:
198
223
Any help is appreciated.
print ($hits{'values'}, "\n"
print ($hits{'files'}, "\n" );
this gives the output:
...
ABS.45354
23442
ABS.45354
23875
ABS.45353
245764
ABT.3133
198
ABT.3133
223 ... and so on for all files in a directoy.
Note that the ABS.45353 is the filename which is the common factor. However my problem is how to output to a file every array element associated with ABS.45353 so that I end up with a sorted file containing a list of the numbers associated with each corresponding file:
e.g: files ABS.45353 containing:
23442
23875
245674
e.g: file ABT.3133 containing:
198
223
Any help is appreciated.