On Wednesday, November 19, 2003, at 12:28 PM, Smylers wrote:
Larry Wall writes:
: Michael Lazzaro wrote:
:
: >    return if $a { $a }

No, it's a syntax error. You must write

Excellent!

I too was quietly hoping someone would say that. These hurt my admittedly ever-shrinking brain:


        return if $a;          # our old friend
        return if $a { $a }    # ow!  me noggin!  Always returns, or not?

The C<do> encapsulation helps clarify enormously:

return do { if $a { $a } }

... well, OK, maybe not enormously... I'd still be annoyed if anyone actually wrote that with a straight face, but there's nothing offensive about it being legal.

MikeL



Reply via email to