in reply to Looping in hash table and get each row value

my @array = values %hash;

Replies are listed 'Best First'.
Re^2: Looping in hash table and get each row value
by hikarihikari (Initiate) on Jun 06, 2013 at 07:37 UTC
    hi thank you for this but what I mean is I want to get EACH row value in the hash table not just store all its value in an array..

      Can you specify what you mean by "row value in the hash table" ? Some example?

        my %hash; open (INPUT, "file") or die "Can't open file: $!"; my $records = <INPUT>; chomp($records); while (<INPUT>){ my @arr = split (/\ /, $_); my ($key, $value) = ($arr[1], $[0]); $srcid_hash{$key} = $value; print "$key\t$value\n"; }
        My code goes like that and I checked it it's working since I got to store the values of the file in a hash table. My next target is to loop within my hash and get each row value and will use that value in listing a file.