http://qs1969.pair.com?node_id=576517


in reply to Regex Start Anchor with variables

Even faster than index() or a regex -- I would imagine -- would be substr() and eq together.
if (substr($large, 0, length($small)) eq $small) { ... }

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart