develooper Front page | perl.fwp | Postings from March 2002

Re: rethinking printf

Thread Previous | Thread Next
From:
Rich Morin
Date:
March 6, 2002 21:09
Subject:
Re: rethinking printf
Message ID:
p05100305b8aca4b08e44@[192.168.254.205]
At 11:24 PM -0500 3/6/02, Uri Guttman wrote:
>.... qn would be just like qq but not allow any
>direct hash interpolations (%foo or %foo{bar}). you can always get those
>with $() if needed. this solves the common case with a minimal of noise
>and the uncommon case has a simple out of using $(). no need for wacko
>ways to put in \n. it is double quotish in all ways but one and mainly
>to be used for printf format strings.

I also like this because it allows a typical format string to be converted
merely by adding a two-character prefix:

   printf("The value is %7.2f\n", $foo);
   ---
   printf(qn"The value is %7.2f\n", $foo);

-r
-- 
email: rdm@cfcl.com; phone: +1 650-873-7841
http://www.cfcl.com/rdm    - my home page, resume, etc.
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc     - Prime Time Freeware's Darwin Collection

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