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