An approach that begins with a single RegEx. Handles unexpected inputs.
#!/usr/bin/perl -w
use strict;
use warnings;
my ($match, $status, $date);
foreach (<DATA>) {
$_ =~ /^"(Submitted)(?: on )(.*)"|(Not started)"/;
# ^^^^^^^^^ ^^ ^^^^^^^^^^^
# $1 $2 $3
if (defined $1) {
($match, $status, $date) = ("Y", $1, $2);
} elsif (defined $3) {
($match, $status, $date) = ("Y", $3, "-");
} else {
($match, $status, $date) = ("N", "-", "-");
}
print "[", join("][", ($match, $status, $date)), "]\n";
}
__DATA__
"Submitted on Oct 1st, 2013"
"Not a match!"
"Not started"
This program produces the output:
[Y][Submitted][Oct 1st, 2013]
[N][-][-]
[Y][Not started][-]