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;
|
my %payments;
|
||||||
foreach my $ticketSpec (@ticketSpecs) {
|
foreach my $ticketSpec (@ticketSpecs) {
|
||||||
my $paymentMethod = FindMostRecentPaymentMethodForTicket($ticketSpec);
|
my $paymentMethod = FindMostRecentPaymentMethodForTicket($ticketSpec);
|
||||||
warn "Cannot find payment method for ticket, $ticketSpec" unless defined $paymentMethod;
|
print STDERR "$ticketSpec has payment method of $paymentMethod\n" if ($VERBOSE > 6);
|
||||||
$paymentMethod = "UNKNOWN PAYMENT METHOD";
|
if (not defined $paymentMethod) {
|
||||||
|
warn "Cannot find payment method for ticket, $ticketSpec";
|
||||||
|
$paymentMethod = "UNKNOWN PAYMENT METHOD";
|
||||||
|
}
|
||||||
push(@{$payments{$paymentMethod}}, $ticketSpec);
|
push(@{$payments{$paymentMethod}}, $ticketSpec);
|
||||||
}
|
}
|
||||||
foreach my $paymentMethod (sort { $a cmp $b } keys %payments) {
|
foreach my $paymentMethod (sort { $a cmp $b } keys %payments) {
|
||||||
|
|
Loading…
Reference in a new issue