[Israel.pm] List of all contexts in Perl

Offer Kaye offer.kaye at gmail.com
Sun May 30 12:18:08 PDT 2010


On Sun, May 30, 2010 at 7:18 PM, Yuval Kogman wrote:
>
> In the context of Want

When Terminologies Collide! Movie at 10!
I fear the word "context" is being rather heavily overloaded in this
discussion ;)

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

Except for looking at the opcodes, how can you tell there is a
difference in context here? Shouldn't these 2 paragraphs do exactly
the same, from my viewpoint as a user?
If the opcodes are the same, doesn't that mean calling one of the
options "boolean context" and the other "not boolean context" is
wrong?
If the opcodes are different but the end result the same, this seems
like a nice place for optimization (by letting the more
memory/cpu-intensive/longer-runtime option collapse to the first), no?
:)

Regards,
-- 
Offer Kaye


More information about the Perl mailing list