http://qs321.pair.com?node_id=970854


in reply to Re^2: Help required on Getopt::Long
in thread Help required on Getopt::Long

but that seems to be easily remedied with anchors in the expression (and -- for ease of illustration -- using a defined array rather than @ARGV):
#!/usr/bin/perl use 5.014; my $count; my @arr = qw/helper abc help def helpless helpful whelp help/; $count = grep {/^help$/}@arr and print "This is a help message. "; +# Note1 say "\$count: $count"; # This is a help message. $count: 2
Note1: can also be written $count = grep /^help$/, @arr ....