in reply to Split on 2nd Occurence

The easiest way that I can think of would be within a match rather than by splitting based upon a match pattern ...

my $ipaddr = "192.168.8.205"; my ($iprefix, $ipstuff) = $ipaddr =~ m/(\d+\.\d+)\.(\d+\.\d+)/; print $iprefix, " ", $ipstuff, "\n";

 

perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'