- or download this
for my $i (1..10) {
# some stuff with $i
}
- or download this
my $i;
for $i (1..10) {
# some stuff with $i
}
- or download this
{
my $i;
...
# some stuff with $i
}
}
- or download this
for (int i=0, i<5; i++) {
...
}
// i in still in scope here!
- or download this
foreach my $var ('a', 'b') {
...something that may modify $var...
print($var);
}
- or download this
foreach ('a', 'b') {
my $var = $_;
...something that may modify $var...
print($var);
}