in reply to Re^3: [5.10] =~ vs ~~
in thread [5.10] =~ vs ~~

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...

--
If you can't understand the incipit, then please check the IPB Campaign.