in reply to multiple files and hashed

You wouldn't want to do that. That would involve symbolic references, and if you're asking the question 'What is a symbolic reference?' you definitely should not be using them. In fact there is almost never a reason to use them.

What you want is a HoH (Hash of Hashes).

%hash = { filename1 => { id1 => 1, id2 => 1 }, filename2 => { id1 => 3, id2 => 4 } };

like this:

use strict; use warnings; #NOT TESTED my %filehash; for ($i=1; $i<=$number; $i++) { my $filename = "file$i"; open (lookup, "<$filename") or die "Can't open $filename : $!\n"; while (<lookup>) { ($ref_name, $ref_id) = (split /\t/, $_)[3,4]; $filehash{$filename}{$ref_id} = $ref_name; } }


grep
One dead unjugged rabbit fish later

Replies are listed 'Best First'.
Re^2: multiple files and hashed
by Anonymous Monk on Nov 06, 2006 at 16:54 UTC
    thanks for all your replies and help pointing me in the right direction