in reply to printing array values
#!/usr/local/bin/perl -w use strict; open(IN, '<', "test_file.txt"); my %fvalues; while(<IN>){ if (/(.*) (.*)/){ $fvalues{$2} = $1; print " While : $fvalues{$2}\n"; # this one prints } } for(my $counter = 1 ; $counter < 6 ; $counter++){ print " For : $fvalues{$counter}\n" ; # no output } close(IN);
|
|---|