I'd recommended using index because of (inter alia) some gnarly behavior with empty patterns. But it turns out it was even more gnarly than I thought.
BTW, perlreref says
If 'pattern' is an empty string, the last I matched regex is used.What is the 'I' in 'I matched'? I couldn't find it mentioned again in perlre or perlreref, and searching on 'I' turned out to be ... overproductive.
throop
In reply to Re^4: Style question: regex versus string builtin function
by throop
in thread Style question: regex versus string builtin function
by eyepopslikeamosquito
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |