http://www.perlmonks.org?node_id=350231


in reply to Re: fast bit twiddling
in thread fast bit twiddling

Refinement of emazep's:
sub dani_l { my $s = shift; substr($s, $_ - 1, 2) =~ tr/1// == 1 or return 0 for @_; return 1; }