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

Brainstorming 5.12 syntax features

Thread Next
David Nicol
July 16, 2009 10:38
Brainstorming 5.12 syntax features
Message ID:
On Thu, Jul 16, 2009 at 9:51 AM, Rafael
Garcia-Suarez<> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About