- or download this
# find sum of first 100 digits
my $sum = 0;
for my $i (0 .. 99) {
$sum += $i;
}
- or download this
# print lines from a file handle and stop when done
while (my $line = <FILE>) {
print $line;
}
- or download this
for (0 .. 99) {
print "$_\n";
last if $_ == 42;
}
- or download this