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

Re: [FWP] perl5 is 5



>From vlb@cfcl.com  Tue Oct 19 11:34:42 1999
Date: Tue, 19 Oct 1999 13:28:03 -0500
Message-ID: <19991019132803.E3593@psiphi.org>
In-Reply-To: <Marcel-1.46-1019164652-b49Rr9i@waveney.demon.co.uk>
Organization: Psi Phi, <URL:http://www.psiphi.org/>

On Tue, Oct 19, 1999 at 05:46:52PM +0100, Richard Proctor wrote:
> for(0..3){print"Happy birthday ".(/2/?"dear perl5":"to
>you").(/3/?".":",")."\n"}
>
> Can anybody get it smaller...

Shave off two characters by converting the 'for' to a 'map', moving
the list to the end, getting rid of the parens.  It throws away the
return values:

map{print"Happy birthday ".(/2/?"dear perl5":"to
you").(/3/?".":",")."\n"}0..3

It's not much of a difference though.

David Henderson
-- 
For the latest news about Star Trek and Buffy books, visit Psi Phi!
Star Trek Books: http://www.psiphi.org/cgi/upc-db/           <*>
Buffy TVS Books: http://www.psiphi.org/cgi/buffy-db/

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