I don't think you're entirely correct. The code which I posted (feature::each_on_array) works on my 5.10. And I did not override "each" globally, only on the caller's package.

% perl -I. -Mfeature::each_on_array -E'say $^V; @a = (qw/a b c/); whil +e (($i, $e) = each @a) { say $i, $e }' v5.10.1 0a 1b 2c
vs
% perl -I. -Mfeature::each_on_array -E'say $^V; @a = (qw/a b c/); whil +e (($i, $e) = each @a) { say $i, $e } package Foo; @b = (qw/a b c/); +while (($i, $e) = each @b) { say $i, $e }' Type of arg 1 to each must be hash (not array dereference) at -e line +1, near "@b) "

Perl here does call our subroutine's each.

I'll be packaging this as a CPAN module; I need this to work on a 5.10 box, and I want to see CPAN Testers result. I'm including Tie::ArrayAsHash for now.


In reply to Re^4: Making each(@ary) work on 5.10? by sedusedan
in thread Making each(@ary) work on 5.10? by sedusedan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.