Make a copy of $parameter before binding to it:
sub make_print_ref { my ($parameter) = @_; return sub { print $parameter }; }; my $print_ref = make_print_ref(...);
I'm not sure if any of the Curry modules provide such a facility, but it isn't too hard to roll one yourself.
In reply to Re: How to get variable evaluation in anonymous subroutines declaration
by Corion
in thread How to get variable evaluation in anonymous subroutines declaration
by zorglups
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |