my ($variable, $first, $second); $variable = some_data_provider(); if ($variable =~ /: ([0-9.]+) ([0-9.]+)/) { ($first, $second) = ($1, $2); print "Found the values $first and $second!\n"; }