payment method only unknown when not defined
Assure reassignment of variable only happens inside conditional.
This commit is contained in:
parent
d6375aefd6
commit
6b8f3fac77
1 changed files with 5 additions and 2 deletions
|
@ -54,8 +54,11 @@ my @ticketSpecs = TicketIDsReadyForPayment();
|
|||
my %payments;
|
||||
foreach my $ticketSpec (@ticketSpecs) {
|
||||
my $paymentMethod = FindMostRecentPaymentMethodForTicket($ticketSpec);
|
||||
warn "Cannot find payment method for ticket, $ticketSpec" unless defined $paymentMethod;
|
||||
$paymentMethod = "UNKNOWN PAYMENT METHOD";
|
||||
print STDERR "$ticketSpec has payment method of $paymentMethod\n" if ($VERBOSE > 6);
|
||||
if (not defined $paymentMethod) {
|
||||
warn "Cannot find payment method for ticket, $ticketSpec";
|
||||
$paymentMethod = "UNKNOWN PAYMENT METHOD";
|
||||
}
|
||||
push(@{$payments{$paymentMethod}}, $ticketSpec);
|
||||
}
|
||||
foreach my $paymentMethod (sort { $a cmp $b } keys %payments) {
|
||||
|
|
Loading…
Reference in a new issue