jaffinito34 has asked for the wisdom of the Perl Monks concerning the following question:
I'm running into an error in my script. It is supposed to keep track of each time the $remoteIP variable changes and add to the counter for each time it does, however, the counter goes up each time through the loop. Any ideas why?
#reading log file and assigning values while ($lines = <LOG>){ $remoteIP = $oldIP; ($remoteIP,$rfc,$userID,$dateTime,$timeZone,$requestType,$fileRequ +ested,$requestProtocol,$statusCode,$sizeOfFile) = split ' ', $lines; if ($oldIP ne $remoteIP){ $IPcount += 1; } print "$IPcount\n"; ...
I'm an idiot...
$oldIP = $remoteIP;
|
|---|