in reply to read value from file won't pass if exists??
withprint "$miss";
and make sure there are no spaces, trailing characters, or anything else getting in the way. The following works for me.print "'$miss'\n";
#!/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 |