sub getFiles { my @fileNames = ( 'manimp1.txt', 'manimp2.txt' ); for my $file ( @fileNames ) { open my $FILE, '<', $file or die "Couldnt open file: $file because: $!"; while ( <$FILE> ) { chomp; my ( $key, @line_array ) = split /\t/; $newPrices{ $key } = \@line_array; } $count += $.; delete $newPrices{ 'Part Num.' }; } }