sub is_rotatable{ #234567890123456789012345678901234567 $_=$_[0];y/2569347/5296/;pop==reverse } for my $i(3,33,131,141,171,25696925,101,88) { printf "%s %s rotatable\n", $i, is_rotatable( $i ) ? 'is' : 'not' } __DATA__ 3 not rotatable 33 not rotatable 131 not rotatable 141 not rotatable 171 not rotatable 25696925 is rotatable 101 is rotatable 88 is rotatable