) { chomp; $hash_table{$_} = 0; } close IN; print "$_ = $hash_tab..." /> How To Read File Into Hash Array ? ) { chomp; $hash_table{$_} = 0; } close IN; print "$_ = $hash_tab..." /> ) { chomp; $hash_table{$_} = 0; } close IN; print "$_ = $hash_tab..." />
Answers

Question and Answer:

  Home  Perl Programming

⟩ How to read file into hash array ?

open(IN, "<name_file")

or die "Couldn't open file for processing: $!";

while (<IN>) {

chomp;

$hash_table{$_} = 0;

}

close IN;

print "$_ = $hash_table{$_}n" foreach keys %hash_table;

 196 views

More Questions for you: