in reply to smart match operator should be smarter!

This doesn't work at all for me:
my @arr1 = (2, 34); say "34" if @arr1 ~~ 34; #no output...??

This works for me. (it says "34")

This doesn't work either:
my @arr1 = ('hello', 'goodbye'); say "array size is 2" if @arr1 ~~ 2;

This also works as documented (no output except warnings about comparing numeric value with strings)

Replies are listed 'Best First'.
Re^2: smart match operator should be smarter!
by ikegami (Patriarch) on Nov 21, 2009 at 18:40 UTC
    You must be using 5.10.0, where the implementation had many bugs.

      Yes, I'm using 5.10.0 (from Ubuntu 9.10, so it's not exactly 5.10.0), but I doesn't see any bugs. It looks like it works as it should work.

        Fixing the aforementioned bugs required making ~~ non-commutative.