http://www.perlmonks.org?node_id=894408


in reply to Re^2: How to add an exceptio for"for loop"
in thread How to add an exceptio for"for loop"

I think you may be confusing the command line grep with Perl's grep command. my @selected = grep { $_ ne "." } @some_array selects elements based on whether the content of {....} returns true or false. As { $_ ne "."} is only true on an exact non-match with ".", it will exclude only ".".

".foobar", "foo.bar", etc. will pass the test, i.e. { $_ ne "."} will be true, and therefore will be in @selected.