Syntax::Feature::EachOnArray - Emulate each(@array) on Perl < 5.12
version 0.04
# This can run on Perls older than 5.12 and have no effect on 5.12+ use syntax 'each_on_array'; my @a = (qw/a b c/); while (my ($idx, $item) = each @a) { ... }
Beginning with 5.12, Perl supports each() on array. This syntax extension emulates the support on older Perls.
No uninstall() yet.
Thanks to Toby Inkster for writing the tie handler.
This module originates from this discussion thread: http://www.perlmonks.org/?node_id=983878
syntax
Syntax::Feature::KeysOnArray
Syntax::Feature::ValuesOnArray
Array::Each::Override (written in 2007, before Perl 5.10). Didn't find out about this module until after I uploaded Syntax::Feature::EachOnArray to CPAN. This module, although not using the syntax syntax, does everything Syntax::Feature::{Each,Keys,Values}OnArray does and more. Take a look at it.
Steven Haryanto <stevenharyanto@gmail.com>
This software is copyright (c) 2013 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Syntax::Feature::EachOnArray, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Syntax::Feature::EachOnArray
CPAN shell
perl -MCPAN -e shell install Syntax::Feature::EachOnArray
For more information on module installation, please visit the detailed CPAN module installation guide.