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

Brainstorming 5.12 syntax features

Thread Next
From:
David Nicol
Date:
July 16, 2009 10:38
Subject:
Brainstorming 5.12 syntax features
Message ID:
934f64a20907161038y3740024er71bd1572d7d8e453@mail.gmail.com
On Thu, Jul 16, 2009 at 9:51 AM, Rafael
Garcia-Suarez<rgarciasuarez@gmail.com> wrote:
> Ah, so you were making the assumptions that the sub to call is known
> at compile time and that it would never change during the lifetime of
> the program. This is Perl, so those are wrong assumptions :)

anyone for "local sub" shorthand?

$ perl -le 'sub X {"outer"} { local sub X {"inner"} print &X } print &X'

could become equivalent to

$ perl -le '*sub X {"outer"}; { local *X = sub {"inner"}; print &X } print &X'

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