use strict; use warnings; my $count = 1; while ($count < $ARGV[1]) { prn("$count\n"); } sub prn { print $_[0]; }