in reply to index using a range

> I know I can use pos or substitute for non-zero values and then do index but is there a way to do that directly?

pos is the way to do it directly.

DB<111> $str1 = "000001";$str1 =~ m/[^0]/g; print pos($str1) 6

Cheers Rolf

( addicted to the Perl Programming Language)