local *FH; # need this if in a loop or repeated sub open FH, 'blah' or die "can't open blah: $!\n"; $$LOG{$foo}[$blah] = \*FH; $in = readline($$LOG{$foo}[$blah]); # don't try <>, it doesn't like complex structures print {$$LOG{$foo}[$blah]} $out; # must use a block {} for the filehandle