use strict; use warnings; sub ten { 10 } print "9 .. 10 - 1 without constant\n"; for my $i (9 .. 10 - 1) { print $i, "\n"; } print "-> expected\n\n"; print "9 .. 10 - 1 with constant()\n"; for my $i (9 .. ten() - 1) { print $i, "\n"; } print "-> expected\n\n"; print "9 .. 10 - 1 with constant\n"; for my $i (9 .. ten - 1) { print $i, "\n"; } print "-> unexpected\n\n"; print "9 .. 10 with constant\n"; for my $i (9 .. ten) { print $i, "\n"; } print "-> expected\n\n"; #### 9 .. 10 - 1 without constant 9 -> expected 9 .. 10 - 1 with constant() 9 -> expected 9 .. 10 - 1 with constant 9 10 -> unexpected 9 .. 10 with constant 9 10 -> expected