use Text::CSV_XS; my $csv = Text::CSV_XS->new({ 'quote_char' => '"', 'escape_char' => '"', 'sep_char' => ',', 'binary' => 1 }); open FH, "< textfile.txt" or die "Failed to open CSV file for processing: $!"; my @csv=(); close(FH) or die "Failed to close CSV file for processing: $!"; my @ignore_merchants=('merchant 1','merchant 2'); foreach my $line (@csv) { if ($csv->parse($line)) { my @fields = $csv->fields; $offer{retailer}=$fields[0]; $offer{productid}=$fields[1]; foreach (@ignore_merchants) { # now I want to skip to the next element in the outer loop. How can I do that anyway? next if ($_ eq $offer{retailer}); } }