Help for this page
my $input = "(55.950254, -3.187606)"; ( my $output = $input ) =~ s{([-\d.]+), # capture the first number to + $1 ... {$2 $1}x; # reverse $1 & $2 print $output;