in reply to multiple files and hashed

You're looking for symbolic references (aka "getting a variable name from a variable"). It's rarely a good idea to use symbolic references in a Perl program - which is why they are one of the features that "use strict" disables.

It looks like what you want here is an array of hashes.

my @data; for ($i=1; $i<=$number; $i++) { open (LOOKUP, '<', "file$i"); while (<LOOKUP>) { chomp; my ($ref_name, $ref_id) = (split /\t/, $_)[3,4]; $data[$i]{$ref_id} = $ref_name; } }

See perldsc for more details on building Perl data structures.

--
<http://dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg