ashnator has asked for the wisdom of the Perl Monks concerning the following question:
Howto create a Hash array from a file format like this :- SNPSTER2_50_3_1_119_588 10 SNPSTER2_50_3_1_121_522 16 SNPSTER2_50_3_1_119_260 27 My code #!/usr/bin/perl -w %href; $fn=<>; open(FH,"$fn") || die("Cannot open:$!"); while(<FH>) { @_=split('\t',$_); $key = @_[0]; $href{$key} = @_[1]; while (($key, $value) = each(%href)) { print $key.", ".$value."\n"; } } I am not getting values
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Creating hash Array
by johngg (Canon) on Oct 20, 2008 at 10:26 UTC | |
by Anonymous Monk on Oct 20, 2008 at 15:27 UTC | |
Re: Creating hash Array
by Corion (Patriarch) on Oct 20, 2008 at 06:53 UTC | |
Re: Creating hash Array
by Punitha (Priest) on Oct 20, 2008 at 07:41 UTC | |
by blazar (Canon) on Oct 21, 2008 at 09:40 UTC | |
Re: Creating hash Array
by brsaravan (Scribe) on Oct 20, 2008 at 14:19 UTC | |
Re: Creating hash Array
by blazar (Canon) on Oct 21, 2008 at 09:30 UTC |