in reply to How should I store/retrieve my data

my %h; for my $file ( glob "*.[abc]" ) { my( $file_k0, $file_k1 ) = $file =~ /(.*)\.(.*)/; local @ARGV = ($file); while (<>) { chomp; push @{ $h{$file_k0}{$file_k1} }, [ split /\t/ ]; } }
Then what you have in %h is a hash of hash of array of array. The two levels of hash are for the two parts of the filename. The values of the second-level hash are arrays representing the lines of the file. Each line is an array of the tab-delimited fields.

So, to iterate over the thing fully, you could do:
for my $file_k0 ( sort keys %h ) { for my $file_k1 ( sort keys %{ $h{$file_k0} } ) { print "File $file_k0.$file_k1 -\n"; for my $line_ar ( @{ $h{$file_k0}{$file_k1} } ) { for my $field ( @$line_ar ) { print "\t$field"; } print "\n"; } } }

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.