First page Back Continue Last page Overview Graphics
Iteration in Perl
Iterators are used to work on a range of data from a list or hash or other container.
“Get next” idiom
while (<>) { print; }
foreach idiom
foreach $name (@names) {
if (substr($name, 0, 1) eq “a”) {
print “$name\n”;
}
}