use strict; my %href; my $fn=<>; open(FH,"$fn") || die("Cannot open:$!"); while() { my @array =split('\t',$_); ###@array is the array variable my $key = $array[0]; $href{$key} = $array[1]; } while (my ($key, $value) = each(%href)) { print $key.", ".$value."\n"; }