in reply to splitting headache

I think you might better do so with a pattern-matching, e.g.
my @result = $string =~ /^([^\.]\.[^\.])(:?\.([^\.]))*$/;
or something the like.

Or use split and some after-working:

my ($firstPart, @result) = split(/\./, $string); $result[0] = $firstPart . "." . $result[0];

Best regards,
perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Replies are listed 'Best First'.
Re: Re: splitting headache
by Wibble (Beadle) on Feb 26, 2002 at 14:45 UTC
    Thanks for the reply. I should have explained that my "Pugh.Pugh.Barney.McGrew.Cuthbert.Dibble.Grub" string was just a typical string that might occur. The 'word.groupings' would actually come anywhere, not just at the start. Thanks again though.