in reply to Re: 99 Problems in Perl6
in thread 99 Problems in Perl6

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.

Replies are listed 'Best First'.
Re^3: 99 Problems in Perl6 (??=!!)
by tye (Sage) on Dec 16, 2006 at 00:39 UTC

    I thought I read recently that in Perl 6, this:

    ... ?? $previous = $x !! ...;

    would be a syntax error. You need parens (I think Pugs lets you get away with this for now but that will get fixed eventually).

    - tye        

      Indeed, you recall correctly; see 587242.