Good points, thank you. I suppose if I really want to confuse people (again, pretty darned close to Perl 5):
my $compress = do { my $previous; sub ($x) { $x ne $previous ?? $previous = $x !! return; }; }
That works just fine, but it might give someone pause :) Of course, I wouldn't write it like that for production.
Cheers,
Ovid
New address of my CGI Course.
In reply to Re^2: 99 Problems in Perl6
by Ovid
in thread 99 Problems in Perl6
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |