use strict; use warnings; my $date = '03/16/2010'; my $new_date = join '-', reverse split m{/}, $date; return $new_date;