in reply to Re: value returned on m// failure
in thread value returned on m// failure
i am quite aware of what values are ture and what are false. explicitly, undef and empty string are false values. and the perlop says...
m/PATTERN/cgimosx
/PATTERN/cgimosx
Searches a string for a pattern match, and in
scalar context returns true if it succeeds, false
if it fails. ...
...it doesn't say anything about what the actual values are.
i was asking why is that to express success number 1 is returned, yet a non-number is returned on failure. is it an implementation detail/decision such that empty string is easier/faster to return than the number 0?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: value returned on m// failure
by pfaut (Priest) on Dec 31, 2002 at 01:41 UTC | |
by parv (Parson) on Dec 31, 2002 at 05:15 UTC | |
|
Re: Re: Re: value returned on m// failure
by MarkM (Curate) on Dec 31, 2002 at 04:50 UTC | |
by parv (Parson) on Dec 31, 2002 at 05:41 UTC | |
|
Re: Re: Re: value returned on m// failure
by pg (Canon) on Dec 31, 2002 at 01:39 UTC |