Unlike pretty much any other function that returns 'false' in Perl, meaning 0or a negative numberof undef, the index() function returns the '-1' string rather than the actual number -1.
Yes, and that's to avoid the semipredicate problem. (Without warnings enabled, evaluate undef + 0 and see what you get.)
I have no idea what your title means though; it's just wrong.
In reply to Re: Perl index() Function Returns String, Not Numeric
by chromatic
in thread Perl index() Function Returns String, Not Numeric
by ironmo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |