http://qs321.pair.com?node_id=1171492


in reply to Re: Get a known substring from a string
in thread Get a known substring from a string

That is equivalent to $found = 'thispart' if 1+index( $str, 'thispart' );, but index is 3 times faster:

s='the quick brown fox jumps over the lazy dog'; cmpthese -1,{ a => q[ if( $s =~ m[(lazy)] ){ $found=$1 } ], b => q[ $found = 'lazy' if 1+index( $s, 'lazy' ); ], };; Rate a b a 585631/s -- -77% b 2535746/s 333% --

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.