++ for kenneth, but I prefer to name the iteration item. This way, if your routine grows larger, it's easy to identify what is what, instead of relying on $_:
#!/usr/bin/perl use warnings; use strict; use constant VALUES => qw( 1 2 3 4 5 ); for my $value ( VALUES ) { print "$value\n"; }
Steve
In reply to Re: Loop through a constant array
by stevieb
in thread Loop through a constant array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |