in reply to Perl index() Function Returns String, Not Numeric

Most of my uses of index look something like

if( $p = 1+index( $str, $sought ) ) { ## Do something with $p ## remembering that it's +1 ## but most times, that what you want anyway. }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.