http://qs321.pair.com?node_id=718158


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