Set $pass to binary value; rename $date to $mentorDate.

This commit is contained in:
Bradley M. Kuhn 2018-07-15 09:04:31 -07:00
parent 0d564dd4fd
commit aa5e41555e

View file

@ -47,15 +47,17 @@ while (my $file = readdir $dh) {
next; next;
} }
my($pass, $name) = ($1, $2); my($pass, $name) = ($1, $2);
$pass = ($pass =~ /success/) ? 1 : 0;
open(my $fh, "<", File::Spec->catfile($PAYMENT_DIR, $file)); open(my $fh, "<", File::Spec->catfile($PAYMENT_DIR, $file));
my $date; my $mentorDate;
while (my $line = <$fh> ) { while (my $line = <$fh> ) {
if ($line =~ /^\s*Date\s*:\s*(.+)\s*$/) { if ($line =~ /^\s*Date\s*:\s*(.+)\s*$/) {
$date = UnixDate(ParseDate($1), "%Y-%m-%d"); $mentorDate = UnixDate(ParseDate($1), "%Y-%m-%d");
next; next;
} }
} }
die "Inside $file there is no valid Date:" if (not defined $date); die "Inside $file there is no valid Date:" if (not defined $mentorDate);
my(@nameComponents) = split(/\s*-\s*/, $name); my(@nameComponents) = split(/\s*-\s*/, $name);
my(@searchTerms); my(@searchTerms);