for (my $i = 0; $i< scalar @files; $i++) { open FILE,"<",$files[$i]; my $hashname = "wow".$i; while(){ chomp; my @row = split(/\t/,$_); push @{${$hashname}{$row[1]}}, "sth"; #really wanted is push @{$wow1{$row[1]}},"sth" if hash used is "%wow1" when $i==1 } close FILE; }