in reply to 99 Problems in Perl6
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) { ... } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: 99 Problems in Perl6
by gaal (Parson) on Dec 15, 2006 at 22:19 UTC | |
by Ovid (Cardinal) on Dec 15, 2006 at 22:29 UTC | |
by chromatic (Archbishop) on Dec 16, 2006 at 00:06 UTC | |
by gaal (Parson) on Dec 15, 2006 at 22:39 UTC | |
by Ovid (Cardinal) on Dec 15, 2006 at 22:44 UTC | |
by gaal (Parson) on Dec 15, 2006 at 22:54 UTC | |
| |
|
Re^2: 99 Problems in Perl6
by Ovid (Cardinal) on Dec 15, 2006 at 22:22 UTC | |
by tye (Sage) on Dec 16, 2006 at 00:39 UTC | |
by TimToady (Parson) on Dec 16, 2006 at 00:58 UTC | |
|
Re^2: 99 Problems in Perl6
by eric256 (Parson) on Feb 21, 2007 at 18:43 UTC | |
by gaal (Parson) on Feb 21, 2007 at 20:45 UTC | |
by eric256 (Parson) on Feb 21, 2007 at 23:37 UTC |