String::Index provides ncindex and ncrindex, which I think provide what you're after.
my $pos = ncindex($string, 'c'); # find first non-c
The needle string ('c' in this case) can be more than one character, in which case it will find the position of the first character in $string that isn't found in the string of search characters.
Dave
In reply to Re: opposite of index+rindex? How-to? Needed?
by davido
in thread opposite of index+rindex? How-to? Needed?
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |