in reply to Curious find while comparing grep, map, and smart match...

3145 =~ /14/ but not 14 ~~ 3145.

- tye        

Replies are listed 'Best First'.
Re^2: Curious find while comparing grep, map, and smart match... (substring)
by dbuckhal (Chaplain) on Mar 27, 2013 at 01:54 UTC

    That makes sense, hence many single digit values are rarely present.

    Good candidate for a "golf"-ish answer!

    UPDATE: adding word boundaries helped, now the arrays generated are equal.

    map { /\b$rInt\b/ } @mArray

    Thanks!