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

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

Thread Previous | Thread Next
From:
Eirik Berg Hanssen
Date:
September 29, 2016 01:23
Subject:
Re: [perl #129757] for loop doesn't update correct variable
Message ID:
CAHAeAG6SJwQNKc43odp22+YuDXyzjqmnEHa=RfhLBGq9PS-29g@mail.gmail.com
On Thu, Sep 29, 2016 at 3:05 AM, James E Keenan via RT <
perlbug-followup@perl.org> 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).


Eirik

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