in reply to Code review

Superficially, I'd kick this back in code review because the else is "cuddled" and you're not using a LABEL: with the next. You're also don't have use strict; use warnings;. More deeply, you don't need the if and the $Y{$y}++; looks to happen regardless.

Untested reduction, removed implicit $_ for clarity:

use strict; use warnings; my %Y = (); MAINLOOP: while (<>) { ... my ($y) = ... ; next MAINLOOP unless $y; $Y{$y}++; INNERLOOP: foreach my $arg (@ARGV) { next INNERLOOP if $y eq $arg; } }