|There's more than one way to do things|
Comparing a value to hash keyby jaffinito43 (Initiate)
|on Nov 14, 2012 at 01:49 UTC||Need Help??|
jaffinito43 has asked for the
wisdom of the Perl Monks concerning the following question:
I have a script where each time thru a while loop, I need to compare a variable to a hash key to see if its there or not. If it is there, then I need to compare the value of that key to the previous value to see if its greater or not. Then if both criteria are met, the script should perform a print statement, however nothing is printing. Is it possible to check a variable against all the keys in a hash?
This script does not print "YAY IT WORKED", though it should several times. So I also tried this instead of using $logDate in the last if statement:
This time, it prints YAY IT WORKED each time thru the loop because I believe $v$remoteIP is equal to 0. Pretty much Im trying to see whether or not the keys match, and if they do, whether or not the current value in the loop is less than that of the previously stored value for that key