hikarihikari has asked for the wisdom of the Perl Monks concerning the following question:
Update
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 value and will use its value in listing a file. Thank you very much!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], $arr[0]); $hash{$key} = $value; print "$key\t$value\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Looping in hash table and get each row value
by hdb (Monsignor) on Jun 06, 2013 at 07:32 UTC | |
by hikarihikari (Initiate) on Jun 06, 2013 at 07:37 UTC | |
by hdb (Monsignor) on Jun 06, 2013 at 07:43 UTC | |
by hikarihikari (Initiate) on Jun 06, 2013 at 07:51 UTC | |
by hdb (Monsignor) on Jun 06, 2013 at 09:15 UTC | |
|
Re: Looping in hash table and get each row value
by kcott (Archbishop) on Jun 06, 2013 at 07:59 UTC |