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

Re: [perl #77094] printf("a\n" =~ /b/)

Thread Previous
Aristotle Pagaltzis
September 8, 2010 14:27
Re: [perl #77094] printf("a\n" =~ /b/)
Message ID:
* Zefram <> [2010-08-10 18:15]:
> I wrote:
> >sprintf.  The common underlying function is do_sprintf().
> But it turns out that CORE::sprintf has a $@ prototype, and so
> doesn't invoke this bug after all.  I reckon the underlying bug
> is CORE::printf having been given the prototypish behaviour of
> CORE::print rather than that of CORE::sprintf.  This accounts
> for both this stack bug and the undocumented use of $_.

Which it must, because like `print` but unlike `sprintf`, it can
optionally take an FH as indirect argument.

*AUTOLOAD=*_;sub _{s/::([^:]*)$/print$1,(",$\/"," ")[defined wantarray]/e;chop;$_}
#Aristotle Pagaltzis // <>

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About