in reply to confusing question, involving multidemensional arrays
At a basic level you can doe something like this:
my @categories = qw(birds turds flirds); my %data; foreach (@categories) { local *DATA; open DATA, "$_.dat" or die "Can't open $_.dat: $!\n"; $data{$_} = [ <DATA> ]; }
At this point you have a hash with three key/value pairs. The keys are the category names and the values are references to arrays which contain the data from the associated files.
You may well want to do something more structured with the data in the files, but until we know what that is it's difficult to know what.
The are more details on this in the perldoc perldsc manual page.
--Perl Training in the UK <http://www.iterative-software.com>
|
|---|