Help for this page
## Either $mdy =~ m{^(...blahblah...)}; ... ## Or maybe (with a new enough perl) return $mdy =~ s{...}{$3-$1-$2}r;