You could just arrange for the sub definition to be the last evaluated thing inside the do. (This is really no different from Perl 5, except for the formal parameter.)my $compress = do { my $previous; $compress = sub ($x) { ... } };
my $compress = do { my $previous; sub ($x) { ... } }; # or perhaps, my $compress; { my $previous; $compress = sub ($x) { ... } }
In reply to Re: 99 Problems in Perl6
by gaal
in thread 99 Problems in Perl6
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |