More clarification:

On 30 May 2010 13:32, Mikhael Goikhman <[email protected]> wrote:

> On 30 May 2010 12:09:52 +0300, Offer Kaye wrote:
> >
> > I'm not sure I understand what "boolean context" means, or any of the
> > others you listed. Except for the ".." operator does any of Perl's
> > built-in functions operate differently inside an "if" test for
> > example, in terms of the value returned (assuming you assign it to
> > something)?
>

In the context of Want it just checks if the retop operation involves a
boolean operator such that SvTRUE of the return value is the only thing ever
used.

    my $foo = foo();
    if ( $foo ) { # not boolean context


    if ( foo() ) { # boolean context



>  > Looked at another way, you can do anything you want with the return
> > value of for example "localtime", but in the end it will still return
> > either a scalar or list, regardless of what you do with those values
> > later on, right?
>

Correct, the SvTRUE(sv) done by the conditional opcode is kind of like a
method call in this case (and really a method call when overloading is
used), Want merely checks to see if the next and only thing done to the
return value is something specific like that.
_______________________________________________
Perl mailing list
[email protected]
http://mail.perl.org.il/mailman/listinfo/perl

Reply via email to