http://www.perlmonks.org?node_id=968280


in reply to Re: Substring comparison
in thread Substring comparison

Index returns 0 if the match is at the front of the string, i.e. string offset 0.

perl -le 'print index("foobar","foo")'