CoffeeGrinder
Technical User
I've got a string with a varying number of .'s and I want to split on the last occurance of . to put the data into two variables without losing any other characters. How? At the moment I have a solution that uses $1 and $2, but I'd like to be able to do it with a 'simple' split.
if ($data =~ /(.*)\.(\w+)$/)
{
$child_data1=$1;
$child_data2=$2;
}
if ($data =~ /(.*)\.(\w+)$/)
{
$child_data1=$1;
$child_data2=$2;
}