in reply to Matching an IP address
If you need to check the validity of the line, you can wrap that in something like (using the regex from Mastering Reg Exps as cited here):if ( @ips = $line =~ /[\d.]{7,15}/g ) { $client_ip{$ips[0]}{$iteration}++; . . . }
Or, of course combine them: if ( $line =~ /^\s*($iprx):\d+\s*->\s*($iprx):\d+\s*->\s*($iprx)/ ) {$numrx = qr/[01]?\d\d?|2[0-4]\d|25[0-5]/; $iprx = qr/($numrx\.){3}$numrx/; if ( $line =~ /^(\s*($iprx):\d+\s*->){2}\s*$iprx/ ) { . . . }
  p
In Section
Seekers of Perl Wisdom