in reply to Matching IP address continued

I'm guessing that it's because you're mixing /x in $re_line with the plain regexp in $re_ip. This worked fine for me:
#!/usr/bin/perl while( <DATA> ){ chomp; my $re_ip = qr/(\d+\.\d+\.\d+\.\d+):\d+/x; # added /x here + my $re_line = qr/ ^ \s* $re_ip \s* -> \s* $re_ip \s* -> \s* $re_ip + /x; my @results = /$re_line/; printf "%-18s %-18s %-18s\n", @results; } __DATA__ 136.1.1.154:33672 -> 64.210.209.51:80 -> 192.168.1.145:80 tcp 65.201.211.176:14664 -> 64.210.209.54:80 -> 192.168.1.78:80 + tcp 67.38.95.86:2116 -> 64.210.209.50:80 -> 192.168.1.103:80 + tcp 198.49.222.246:52469 -> 64.210.209.54:80 -> 192.168.1.79:80 + tcp 193.80.106.152:3781 -> 64.210.209.61:80 -> 192.168.1.81:80 + tcp 67.28.79.24:3248 -> 64.210.209.54:80 -> 192.168.1.79:80 +tcp 128.187.192.39:1218 -> 64.210.209.54:80 -> 192.168.1.78:80 +tcp 128.187.192.39:1209 -> 64.210.209.51:80 -> 192.168.1.144:80 +tcp
--
Love justice; desire mercy.

Replies are listed 'Best First'.
Re: Matching IP address continued
by Abigail-II (Bishop) on Nov 20, 2002 at 19:00 UTC
    But do you get a failure when you leave out the first /x?

    Abigail

      As it turns out, no. With my tech support days so far behind me, I forgot to assume nothing, even that the problem is real. =) Thanks, Abigail.
      --
      Love justice; desire mercy.