in reply to Golf: List spliting

Do we have to use a sub?
my@r;@l=grep{c($_)?0*push@r,$_:1}@l;
36 total.

blargh: never mind, I just noticed that this is essentially the same thing as Tye's, unwrapped, and with an extra character :)

   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

Replies are listed 'Best First'.
(tye)Re2: Golf: List spliting
by tye (Sage) on Apr 21, 2001 at 02:14 UTC

    Can we give &c a prototype of ($)? my@r;@l=grep c$_?!push@r,$_:1,@l; 33 characters. Update: or: my@r;@l=grep!(c$_&&push@r,$_),@l; also 33 characters. Update: or: my@r;@l=grep{!c$_||!push@r,$_}@l; also 33 characters. (and I'm having a hard time counting)

            - tye (but my friends call me "Tye")