my ($creditcard) = $row =~ /(3[47]\d{13})/ or next; # In der nächsten Zeile weitermachen if (is_valid($creditcard)) {...}