in reply to read value from file won't pass if exists??

The code you pasted doesn't compile (it's missing a semicolon after the print line). That's not that big a deal, but it's always important to test the exact code you're going to be posting. In this case, it definitely should work with the chomp in place. Have you tried checking exactly what the line contains? That is, replace
print "$miss";
with
print "'$miss'\n";
and make sure there are no spaces, trailing characters, or anything else getting in the way. The following works for me.
#!/usr/bin/perl -w %clocks=("10", 0,"10.20.20.10", 0,"10.20.46.13", 0,"10.20.46.37",0); my $miss=<DATA>; chomp $miss; #my $miss="10"; print "'\Q$miss\E'\n"; if (exists $clocks{$miss}){ print "Yup it's there\n"; } __DATA__ 10.20.46.13

Replies are listed 'Best First'.
Re^2: read value from file won't pass if exists??
by lcollins (Novice) on Jan 04, 2005 at 14:50 UTC
    Sorry first posting. Thanks for the help.