http://qs321.pair.com?node_id=11121060


in reply to Python gave me a colonic (solved - brainfart)

It is valid code. else: is a label, and LABEL BLOCK is valid perl syntax.

Replies are listed 'Best First'.
Re^2: Python gave me a colonic
by LanX (Saint) on Aug 24, 2020 at 23:21 UTC
    Correct, but

    > LABEL BLOCK is valid perl syntax.

    to be more precise

    LABEL: and { NAKED BLOCK } are already valid in isolation, they don't need to be compounded.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Re^2: Python gave me a colonic
by bobn (Chaplain) on Aug 25, 2020 at 00:50 UTC
    OK, then, yes, it's a label. I saw else with a colon and didn't even think about labels, even though I've used them many times over the years.

    Actually, it seems a little odd that a keyword is permitted to be used in this fashion, but whatever.

    Thanks for the explanation. I'm gonna blame it on Guido, lol.

    --Bob Niederman, http://bob-n.com

    All code given here is UNTESTED unless otherwise stated.