How to read file into hash array in perl?-Perl interview
How to read file into hash array in perl?-Perl interview
open (IN, "
"(filename in quotes))
or die "Couldn't open file for processing: $!";
while (
) {
chomp;
$hash_table{$_} = 0;
}
close IN;
print "$_ = $hash_table{$_}\n" foreach keys %hash_table;
No comments:
Post a Comment
comment on this post
Note: Only a member of this blog may post a comment.
‹
›
Home
View web version
No comments:
Post a Comment
comment on this post
Note: Only a member of this blog may post a comment.