for ( my @dates = qw( 4-10-31 14-11-31 ) ) { s/ ^ (\d{1,2}) ((?:-\d{1,2}){2}) $ /(2000+$1).$+/xe and print; }