>>>>> "NT" == Nathan Torkington <[EMAIL PROTECTED]> writes: >> Would it be reasonable to ask that passing undef into the offset >> or start of substr have substr return an undef? NT> Wouldn't you get a warning anyway, if you were treating undef like NT> a number? Aha, but I don't want a warning, I want the code to 'fail' reasonably. Somehow I find if (40 == ($foo = substr($bar, index($bar, 'xyz')))) { } much nicer than if (defined ($offset = index($bar, 'xyz')) && (40 == substr($bar, $offset))) { } I use this style of safe failure when working in SQL. <chaim> -- Chaim Frenkel Nonlinear Knowledge, Inc. [EMAIL PROTECTED] +1-718-236-0183
- Re: RFC 213 (v1) rindex and index should return undef on... Tom Christiansen
- Re: RFC 213 (v1) rindex and index should return und... Nathan Wiger
- Re: RFC 213 (v1) rindex and index should return und... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index should return... Nathan Torkington
- Re: RFC 213 (v1) rindex and index should re... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index shoul... Nathan Torkington
- Re: RFC 213 (v1) rindex and index ... Nathan Torkington
- Re: RFC 213 (v1) rindex and in... Chaim Frenkel
- Re: RFC 213 (v1) rindex an... Glenn Linderman
- Re: RFC 213 (v1) rindex an... John Porter
- Re: RFC 213 (v1) rindex an... Glenn Linderman
- Re: RFC 213 (v1) rindex and index should return... John Porter
- Re: RFC 213 (v1) rindex and index should re... Glenn Linderman
- Re: RFC 213 (v1) rindex and index shoul... Chaim Frenkel
- Re: RFC 213 (v1) rindex and index ... Glenn Linderman