my @index2 = grep($_ ne "fourthy", @coins);
I guess you meant
ormy @index2 = grep {$_ ne "fourthy"} @coins);
because in the way you have written it, it would not work (grep needs to eval the first argument (block or string) repeatedly for each item in the argument list).my @index2 = grep('$_ ne "fourthy"', @coins);
In reply to Re: grep usage confusion
by rovf
in thread grep usage confusion
by adrive
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |