in reply to smart match operator should be smarter!

1. This is your untouched code and my results:
use strict; use warnings; use 5.010; my @numbers = (2); my @other = (2); if (@numbers ~~ @other) { say 'yes' }else{ say 'no'; } #output: yes if (@numbers ~~ (2)) { say 'yes' }else{ say 'no'; } #output: yes

2. This is my perl -v:

This is perl, v5.10.0 built for i486-linux-gnu-thread-multi

3. Could you post here the output of your perl -v?

Replies are listed 'Best First'.
Re^2: smart match operator should be smarter!
by 7stud (Deacon) on Nov 23, 2009 at 00:09 UTC

    ikegami said earlier that the smart operator was changed after version 5.10.0. Apparently, it was buggy and too unwieldy to work with. As a result, it is no longer commutative.

    $ perl -v
    
    This is perl, v5.10.1 (*) built for darwin-2level
    
    Copyright 1987-2009, Larry Wall
    
    Perl may be copied only under the terms of either the Artistic License or the
    GNU General Public License, which may be found in the Perl 5 source kit.
    
    Complete documentation for Perl, including FAQ lists, should be found on
    this system using "man perl" or "perldoc perl".  If you have access to the
    Internet, point your browser at http://www.perl.org/, the Perl Home Page.