diff --git a/scripts/rt-outreachy-payment-next.plx b/scripts/rt-outreachy-payment-next.plx index b2aed07..601e0fa 100755 --- a/scripts/rt-outreachy-payment-next.plx +++ b/scripts/rt-outreachy-payment-next.plx @@ -47,15 +47,17 @@ while (my $file = readdir $dh) { next; } my($pass, $name) = ($1, $2); + $pass = ($pass =~ /success/) ? 1 : 0; + open(my $fh, "<", File::Spec->catfile($PAYMENT_DIR, $file)); - my $date; + my $mentorDate; while (my $line = <$fh> ) { if ($line =~ /^\s*Date\s*:\s*(.+)\s*$/) { - $date = UnixDate(ParseDate($1), "%Y-%m-%d"); + $mentorDate = UnixDate(ParseDate($1), "%Y-%m-%d"); 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(@searchTerms);