for (1 .. 100) {
# Do something with $_, which will start with the value 1,
# increasing by one for every loop and stopping with the value 100.
}
####
for ('a' .. 'z') {
# $_ will start with the value 'a', then 'b' all the way up to 'z'
}
for ('aa' .. 'bb') {
# $_ will start with the value 'aa', then 'ab', then 'ac' up to
# 'az', then 'ba' and finally 'bb'
}
##
##
while(<>) {
print if 1 .. 5; #Print lines 1 trough 5 including.
}
##
##
while() {
my $body = /^$/ .. eof; #First blank line in email is start of body
my $header = 1 .. /^$/;
print "looking at line ",int$body," in the body\n" if $body;
print "looking at line ",int$header," in the header\n" if $header;
}
##
##
while(<>) {
my $line = /\S/ ... /^$/;
print "$line:$_" if $line && $line!~/E0$/;
}