in reply to Re: Re: value returned on m// failure
in thread value returned on m// failure
m// returns true or false in scalar context. Perl defines:
| NAME | Value as String | Value as Number | Perl Internal Variable |
|---|---|---|---|
| true | "1" | 1 | PL_sv_yes |
| false | "" | 0 | PL_sv_no |
For evidence, see the source code module perl.c where PL_sv_yes and PL_sv_no are initialized. Also see the pp_match code in pp_hot.c where RETPUSHYES and RETPUSHNO are used to return a boolean value when invoked in scalar context without /g.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: value returned on m// failure
by parv (Parson) on Dec 31, 2002 at 05:41 UTC |