for my $gas_cost (@gasCosts) { if ($gas_cost < 1) { print "Bad gas - $gas_cost\n"; next; } ... }