in reply to Creating hash Array
Hi ashnator
'@_' is the special variable used for subroutine arguments, instead you should use the array variable like
use strict; my %href; my $fn=<>; open(FH,"$fn") || die("Cannot open:$!"); while(<FH>) { 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"; }
Punitha
In Section
Seekers of Perl Wisdom