in reply to Delete Duplicate CA & US holidays

One way you could do it is while you parse the input file keep a count of how many times each date is encountered then filter the holiday info based on that. Consider:

#!/usr/bin/env perl use warnings; use strict; my %holidays; my %common; while (<DATA>) { chomp; next if /^\s*$/ || /^\#/; my $aref = [split /,/, $_]; push @{$holidays{$aref->[2]}}, $aref->[5]; ++$common{$aref->[5]}; } my $countries = keys %holidays; for my $country (keys %holidays) { @{$holidays{$country}} = grep {$common{$_} != $countries} @{$holid +ays{$country}}; }
True laziness is hard work