sub is_rotateable{ local $_ = shift; # Shave two # y/23467/5XX9X/; # return 0 if /X/; y/26/59/; return 0 if /[347]/; @_ = split//; while( @_ > 1 ){ return 0 unless shift == pop; } return 1; }