in reply to Split on 2nd Occurence

The simplest way I can think of is:
my ($iprefix, $ipsuff) = $ipaddr =~ /(\d+\.\d+)\.(\d+\.\d+)/;

Update: sorry rob_au, you posted yours as I was typing this. Not intentional plagiarism... :)

dmm

If you GIVE a man a fish you feed him for a day
But,
TEACH him to fish and you feed him for a lifetime

Replies are listed 'Best First'.
Re: Re: Split on 2nd Occurence
by rob_au (Abbot) on Jan 11, 2002 at 20:18 UTC
    *chuckle* ... It's a pretty obvious solution so I would have been surprised if noone else came up with it - Think of the two of us as merely two monkeys at two typewriters breaking the statistical curve in a room of an infinite number of monkeys :-)

     

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