develooper Front page | perl.fwp | Postings from December 2001

Re: Santa Hole 4 (mid.pl) Post Mortem

Thread Previous | Thread Next
From:
Eugene van der Pijll
Date:
December 7, 2001 16:19
Subject:
Re: Santa Hole 4 (mid.pl) Post Mortem
Message ID:
20011208011908.A4643@ruunat.phys.uu.nl
Rick Klement schreef op 07 december 2001:
> The one I did that I liked was
> 
>   sub{shift,pop while@_>2;print@_}->(<>)

How about:

    sub a{@_>2?shift^pop^&a:print@_}a<>

Note that ^ is almost the only possible operator between shift, pop and
&a here. Most other operators give either a warning or a fatal error.

Eugene

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About