develooper Front page | perl.perl5.porters | Postings from July 2013

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
July 26, 2013 00:27
Subject:
Re: Try/Catch Exception Objects: Possible?
Message ID:
23316.1374798444@chthon
David Golden <xdg@xdg.me> wrote on Thu, 25 Jul 2013 15:11:19 EDT:

> On Thu, Jul 25, 2013 at 12:36 PM, David E. Wheeler <david@kineticode.com<SNIP>
>>
>> This works, of course:
>>
>>     if (my $f = 1) {
>>         say $f;
>>     }

>Yes, despite parens, the "my $f" is outside the *block* defined by the braces.

So what?  It's the topic, part of the topicalizer there.  Makes perfect sense.

Just like how

    for $x (@foo) { }

only has $x work inside that block.  It really does make sense this way.
Taking that away was one of perl6's errors.

--tom

    PS: For sufficiently liberal notions of work, inside, and block. 

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About