Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
So what you really want are anon subs with named arguments. Have you looked at
Unfortunately, the following doesn't work
I also tried Sub::Signatures and Perl6::Subs. Both accept anonymous subs with named parameters. Neither pass the alias test. Maybe one of them can be fixed. Maybe it works with one of the other modules. Update: To spend the least amount of effort, your best bet is to fork signatures. It hooks itself into the parser to change
into
By changing what gets injected (my (...) = @_;) to something like the following, you can achieve aliasing (which also fixes tied vars):
It might be best to use copying semantics by default, while adding a mechanism to specify aliasing ("is rw"?). That would allow you to extend signatures instead of replacing it. In reply to Re^3: Local for lexicals
by ikegami
|
|