in reply to Re^3: Getting for() to accept a tied array in one statement
in thread Getting for() to accept a tied array in one statement

Didn't hdb just do that? :-)
  • Comment on Re^4: Getting for() to accept a tied array in one statement

Replies are listed 'Best First'.
Re^5: Getting for() to accept a tied array in one statement
by LanX (Saint) on Apr 17, 2019 at 09:11 UTC
    and from which Perl version on? :-)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      Strawberry 5.16.3 :)

        I couldn't find any mention in the perldelta and Perldoc.org doesn't list 16.3.

        For loops used to have the limitation to flatten the iterated structure to a list, which resulted sometimes in unfortunate memory requirements.

        IIRC this was partially fixed by parsing if it's an @array or a range-operator, and acting like an iterator (ie for (reverse 1..1e18) remained problematic, because reverse was not detected)

        I'd say this is the essential hook allowing your trick of iterating an "injected" tied array.

        Did I miss something?

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

        exactly! :)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice