in reply to Re^3: Making each(@ary) work on 5.10?
in thread Making each(@ary) work on 5.10?
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.
vs% 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
% 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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Making each(@ary) work on 5.10?
by tobyink (Canon) on Jul 27, 2012 at 13:10 UTC | |
by sedusedan (Pilgrim) on Jul 27, 2012 at 14:08 UTC | |
by tobyink (Canon) on Jul 28, 2012 at 09:48 UTC |