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

A couple of problems. 'true' and 'false' are not keywords in perl, and using next in a do while loop is a no-no, resulting, in this case, in the subroutine returning with the error message: "Exiting subroutine via next at..."


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

Replies are listed 'Best First'.
Re: Re: Re: fast bit twiddling
by esialb (Initiate) on May 03, 2004 at 15:15 UTC
    oof, yes, i seem to have lost some of my perl-fu. i've recently been drawn to the dark side, aka functional languages.
    But I shortened my program even more
    sub stest { my $str = shift; foreach (@_) { substr($str,$_-1,2) =~ /^(10|01)/ || return; } return 1; } #USE: stest( $bit_string, @indexes )