#!/usr/local/bin/perl $string = '10 09'; $regex = '(\d+) (\d+)'; $replace = '$2 $1'; $string =~ s/$regex/$replace/; print "$string \n"; ----------------------- #### # ./test.cgi $2 $1