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

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

Thread Previous | Thread Next
From:
Eric Brine
Date:
September 29, 2011 15:21
Subject:
Re: [perl #100190] RFE: fix sprintf to be consistent with printf andbe useful!
Message ID:
CALJW-qGMZPJXAmHWnj2sOPBcqGRNCfiMYT5Qe7jjvP9OSM=pHg@mail.gmail.com
On Wed, Sep 28, 2011 at 8:51 AM, Johan Vromans <jvromans@squirrel.nl> wrote:

> 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] ...
>

Except the same thing applies to every single builtin (e.g. length, splice,
substr, exit, etc.)


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