in reply to in_array and skipping foreach
Put the ones to skip into a Hash not an array
my %skip; $skip{$_}++ for qw(skip_me and_me and_this_too); foreach my $line (@csv) { if ($csv->parse($line)) { my @fields = $csv->fields; $offer{retailer}=$fields[0]; next if $skip{$offer{retailer}}; $offer{productid}=$fields[1]; } }
Cheers,
R.
|
|---|