perl5ever has asked for the wisdom of the Perl Monks concerning the following question:
and have the curly braces interpreted as an anonymous sub?in_directory "/tmp", { system("..."); ... };
It would nice not to have to write "sub" in front of the opening curly brace.
I know that I can use the (&$) prototype and put my directory parameter after the block, e.g.:
I'm just wondering if there is any possible way of having it the other way around.in_directory { system(...); ... } "/tmp";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: block as second function argument?
by GrandFather (Saint) on Feb 21, 2011 at 05:30 UTC | |
by Sherm (Sexton) on Feb 21, 2011 at 06:17 UTC |