A hash (associative array) is probably the way to go. Maybe something like:
my %proc_data = ( ID1 => [qw{location1 filename1}], ID2 => [qw{location2 filename2}], ... );
To process your files, use something like:
for my $id (keys %proc_data) { my $location = $proc_data{$id}[0]; my $filename = $proc_data{$id}[1]; # file processing code here }
I strongly recommend you put the following two lines at the start of your script to get feedback on errors and possibly dangerous code:
use strict; use warnings;
If you have trouble understanding error or warning messages (they can be quite terse), also add:
use diagnostics;
In addition, I'd recommend the following documentation:
-- Ken
In reply to Re: Howto build an (associative?) array to process files in different locations
by kcott
in thread Howto build an (associative?) array to process files in different locations
by shadowfox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |