wst has asked for the wisdom of the Perl Monks concerning the following question:
I am reading this into 2 hashs : %File2 and %File3 and the key of hash is "00003200".012 00003200Thanksgiving road Thanksgiving Town TT022 A + B S
The above statement always fails. When I do a simple print before if statement by giving actual value of "00003200" , I do see values.@line = parse_line($ln) # this will parse the line using substr and sa +ve each value in array. if (exists $File2{$line[3]} ) { print "Found the match ",Dumper($File2{$line[3]}),"\n"; } else { print "Could not find the match \n"; } # Tried the following and it does not work either : if (exists $File2{"$line[3]"} ) { print "Found the match ",Dumper($File2{"$line[3]"}),"\n"; } else { print "Could not find the match \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: hash question..
by toolic (Bishop) on Nov 22, 2007 at 15:54 UTC | |
by wst (Acolyte) on Nov 22, 2007 at 15:56 UTC | |
by toolic (Bishop) on Nov 22, 2007 at 16:13 UTC | |
by wst (Acolyte) on Nov 22, 2007 at 16:22 UTC |