What's really weird is that say scalar (my @a = ...) behaves differently from my @a = ...; say scalar @a;
I personally believe that actually:
$ perl -wMstrict -E 'say "@{[q|aaa| =~ /./g]}"' a a a $ perl -wMstrict -E 'say "@{[q|aaa| ~~ /./g]}"' 1
FWIW, I realized this while writing the code for Finding differences in binary files: the line that starts with my @l was originally unnecessarily broken in two statements, the first of which was a match with ~~: then I thought I could condense them into one, but for some reason "it didn't work" - until I changed the operator to =~ "just to be sure," that is...
In reply to Re^4: [5.10] =~ vs ~~
by blazar
in thread [5.10] =~ vs ~~
by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |