Help for this page

Select Code to Download


  1. or download this
    sub is_anagram {
        my %hash;
        map { $hash{ join '', sort split '' } ++ } @_;
        return 2 > keys %hash ? 'True' : 'False';
    }
    
  2. or download this
    sub is_anagram {
        return qw( True False )[ eval join 'cmp', map "'$_'", map { join '
    +', sort split '' } @_ ];
    }