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

Re: [perl #129757] for loop doesn't update correct variable

Thread Previous | Thread Next
Eirik Berg Hanssen
September 29, 2016 01:23
Re: [perl #129757] for loop doesn't update correct variable
Message ID:
On Thu, Sep 29, 2016 at 3:05 AM, James E Keenan via RT <> wrote:

> Why, in a similar circumstance, does 'print' behave differently from
> 'printf'?

  It's not different, is it?

  Well, okay, %d in the pattern to printf evaluates it in numeric context
(getting 0), while double-quote interpolation evaluates it in string
context (getting ''), but in either case, the variable is undefined (as you
would see if running the snippets with warnings enabled).


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