in reply to •Re: If Statement
in thread If Statement

3. # The syntax would be ambiguous without it. I forget the exact case,...

It's like this:

if ( $foo ) if ( $bar ) quux(); else # ???
Which if is that else supposed to go with?

Replies are listed 'Best First'.
•Re: Re: •Re: If Statement
by merlyn (Sage) on Nov 05, 2002 at 18:18 UTC
    No, not the dangling-else problem. I already addressed that in "point 2".

    There's something that's in Perl that's not in C that would have made it hard to tell if there was a single expression or a block following. Maybe it's just the anonymous hash constructor, but back when braces were made mandatory, there was no anon-hash constructor, so I don't think that was it.

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.