develooper Front page | perl.perl5.porters | Postings from September 2011

Re: [perl #100190] RFE: fix sprintf to be consistent with printf and be useful!

Thread Previous | Thread Next
From:
Johan Vromans
Date:
September 28, 2011 05:51
Subject:
Re: [perl #100190] RFE: fix sprintf to be consistent with printf and be useful!
Message ID:
m2wrcshltg.fsf@phoenix.squirrel.nl
Eric Brine <ikegami@adaelis.com> writes:

> Ways of using sprintf when the format is in $arg[0]:

Yes, we all know that. It's just stupid you can't write:

  sub my_printf { print ">> " . sprintf(@_) }

but need 

  sub my_printf { print ">> " . sprintf( $_[0], @_[1..$#_] ) }

(OTOH, this *does* look like Real Perl [tm] ... )

-- Johan

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