You can do the closure without needing the explicit $icopy temp variable. Just write the code reference line like:
my $psub = [ sub { $chosen_idx = $_[0] }, $i ];
In reply to Re: Bizarre Results when Creating a Closure
by thundergnat
in thread Bizarre Results when Creating a Closure
by liverpole
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |