redo if ( @gArray && grep { /$rInt/ } @gArray ); ... redo if ( @mArray && map { /$rInt/ } @mArray ); ... redo if ( @sArray && $rInt ~~ @sArray );
The three are not equivalent. grep and map use regular expressions and have code blocks while the other does not. Try it like this:
redo if @gArray && grep /$rInt/, @gArray; ... redo if @mArray && map /$rInt/, @mArray; ... redo if @sArray && /$rInt/ ~~ @sArray;
In reply to Re: Curious find while comparing grep, map, and smart match...
by jwkrahn
in thread Curious find while comparing grep, map, and smart match...
by dbuckhal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |