in reply to Re: how to get alias name of anonymous sub? (closure)
in thread how to get alias name of anonymous sub?
package test; for (A..D) { *{$_}=sub{ print "my name is $_ \n"; }; } package main; test->A(); test->B(); $_="here"; test->C(); test->D(); output: my name is my name is my name is here my name is here
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how to get alias name of anonymous sub? (closure)
by tye (Sage) on Nov 29, 2010 at 08:04 UTC |