use strict; use warnings; my $vmstr = "-1"; my $ymmv = "Mileage "; my ($opstr) = $vmstr =~ /-(\d\d)$/; print "$ymmv'$opstr'\n";