... if ( $columns[6] != 0 ) { # skip exclusions if (ref (my $excl = $exclusions{$columns[1]} ) eq "ARRAY") { # <--- next if grep $_ == $columns[6], @$excl; # <--- } $lastresult_of{ $columns[1] } = $columns[6]; } ... #### $ ./941457.pl --exclude "robocopy dir"=3 --exclude "robocopy dir"=2 ...