sort { $a->[0] cmp $b->[0] }
#map { [ (split)[0] =~ s/\Q$parm_ipv4/ip4.ip4.ip4.ip4/gr, $_ ] } # this is too modern for 5.10.1
map {
- (my $k = (split)[0]) =~ s/\Q$parm_ipv4/ip4.ip4.ip4.ip4/g;
+ (my $k = (split)[0]) =~ s/\Q$parm_ipv4\E/ip4.ip4.ip4.ip4/g;
[ $k, $_ ]
}
do { local $/ = "\n "; <$in> };
return $aa cmp $bb;
} @temp;
}
+ elsif ($which eq "seen")
+ {
+ @temp = sort {
+ (my $aa = $a) =~ s/^([\d.]+)/$1/;
+ (my $bb = $b) =~ s/^([\d.]+)/$1/;
+ $aa =~ s/\Q$parm_ipv4\E/ip4.ip4.ip4.ip4/;
+ $bb =~ s/\Q$parm_ipv4\E/ip4.ip4.ip4.ip4/;
+ return $aa cmp $bb;
+ } @temp;
+ }
print $out @temp;
}
close($in); # close it explicitly, otherwise $? does not get set
550 Administrative prohibition\r
221 test.ex closing connection\r
+++++++++++++++++++++++++++
-ip4.ip4.ip4.ip4 07-Mar-2000 12:21:52
127.0.0.1 07-Mar-2000 12:21:52
+ip4.ip4.ip4.ip4 07-Mar-2000 12:21:52
**** SMTP testing session as if from host 127.0.0.1
**** but without any ident (RFC 1413) callback.
550 Administrative prohibition\r
221 test.ex closing connection\r
+++++++++++++++++++++++++++
+127.0.0.1 07-Mar-2000 12:21:52
127.0.0.1_foo 07-Mar-2000 12:21:52
ip4.ip4.ip4.ip4 07-Mar-2000 12:21:52
-127.0.0.1 07-Mar-2000 12:21:52
**** SMTP testing session as if from host 127.0.0.1
**** but without any ident (RFC 1413) callback.