Is there a way that I can put my anonymous subroutines down in the bottom of my file out of the way like I do with regular subroutines and then put the line where I call it somewhere higher above?
Yes and no.
foo(make_a_closure(".xml")); #or my $x=make_a_closure(".xml"); foo($x); sub make_a_closure { my ($sExt) = @_; return sub { ...#do something with $sExt } }
Best, beth
In reply to Re: What are valid File::Next \%options and anonymous subroutine placement in script
by ELISHEVA
in thread What are valid File::Next \%options and anonymous subroutine placement in script
by gctaylor1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |