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