http://www.perlmonks.org?node_id=248788


in reply to Surpised by foreach iterator limitation

Before around perl 5.004, even "my" was not recognized as a means to qualify the iterator variable as having a new lexical scope.

Most things Perl are defined by their actual implementation, and formed via a relaxed but somewhat controlled sort of evolution. In this case, no, I was not surprised. Most likely, because years ago, I tried it, and realized that it did not work... Thankfully, some good people have worked on making syntax such as "EXPR foreach 1 .. 10" work as I had originally expected. So there is hope yet, if you mention this 'inconsistency' to the right person.

  • Comment on Re: Surpised by foreach iterator limitation

Replies are listed 'Best First'.
Re: Re: Surpised by foreach iterator limitation
by shotgunefx (Parson) on Apr 08, 2003 at 03:14 UTC
    "Before around perl 5.004, even "my" was not recognized as a means..."
    <confession>Didn't know that. OTOH, I don't think I was using my or strict or warnings back then.</confession>

    -Lee

    "To be civilized is to deny one's nature."