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

Re: Try/Catch Exception Objects: Possible?

Thread Previous | Thread Next
From:
David E. Wheeler
Date:
July 25, 2013 19:13
Subject:
Re: Try/Catch Exception Objects: Possible?
Message ID:
BF790A36-1A13-4696-8F19-42F9AAC6B4B2@kineticode.com
On Jul 25, 2013, at 9:11 PM, David Golden <xdg@xdg.me> wrote:

>> This works, of course:
>> 
>>    if (my $f = 1) {
>>        say $f;
>>    }
> 
> Yes, despite parens, the "my $f" is outside the *block* defined by the braces.

Which is not the same as `for my $f () {}`, which is the only place that has the block-scoped lexical declaration outside the block or the parens.

David


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