[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Cartesian Cross-Products in one <80 char line



On Tue, Apr 18, 2000 at 06:03:18PM -0400, Uri Guttman wrote:
> >>>>> "N" == Neko  <tgy@chocobo.org> writes:
> 
>   N> Let's lower the golf score a bit:
> 
>   N>   perl -pale'@r=map{$f=$_;map[@$_,$f],@r?@r:[]}@F}for(@r){$_="@$_"'
> 
>        perl -pale'@r=map{$f=$_;map[@$_,$f],@r||[]}@F}for(@r){$_="@$_"'
> 
> why use ?: when || will do?

|| won't do here.  It puts @r in scalar context and yields the number of
elements, not the list of elements.

Ronald

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe