in reply to Creating hash Array

I don't think you are creating hash array here, instead you are just reading the file content and creating a hash. Moreover use "chomp" whenever you are using file handles.
use strict; use warnings; my %href; my $fn = <>; open(FH, "$fn") || die "Cannot open file"; while (<FH>) { chomp($_); $href{$1} = $2 if $_ =~ /(\S+)\s+(\S+)/; } while (my ($key, $value) = each(%href)) { print $key. ", ". $value."\n"; }