in reply to Naming file handles with variables?

'open' allows you to specify a lexical variable for the filehandle name like such:
open(my $fh, "file.txt") or die("Can't open file.txt"); while(my $line = <$fh>) { # stuff here } close $fh;

See Indirect Filehandles