in reply to &1 is no faster than %2 when checking for oddness. Oh well.
Screw the benchmarks! In fact, screw math!
sub is_odd { my $int = shift; if ( $int =~ /\D/ ) { die "Not an integer, dummy!" } substr($int,-1) =~ /[13579]/; } [download]
Yes, it's a joke.