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:
Jesse Luehrs
Date:
September 28, 2011 16:33
Subject:
Re: [perl #100190] RFE: fix sprintf to be consistent with printf andbe useful!
Message ID:
20110928233311.GG14233@tozt.net
On Wed, Sep 28, 2011 at 04:27:23PM -0700, Linda W wrote:
> Brian Fraser wrote:
> >
> >
> >Uh, you can already do all the stuff you request, y'know:
> >
> >my @arr = ( "%s\n", "hullo" );
> >my $result = sprintf $arr[0], $arr[1..$#etc];
> >say $result;
> ----
> (I thought 'say' was deprecated?  Seems like adding a keyword just
> to add on some desired
> line ending is a road to certain madness ... but .. hey,  ;-).
> ----
> Ya know...for someone who talks like what they think they know what they
> are talking about, they might wanna check their examples before
> telling people
> that they can do "XXX", cuz your example doesn't work (and I wasted
> a bit of time
> thinking you knew what you were talking about!  (dictionary, gullible: me).

This was just a typo - it should have been @arr[1..$#arr], not
$arr[1..$#etc]. With that change, it works fine.

-doy

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