#!/usr/local/bin/perl # Count from 1 to a requested number # Requested number can come as an ARGV or as an entry field $count = $ARGV[0]; # get first argument while ($count eq '') { # if no argument print "Enter a number: "; # prompt for a number $count = ; # read a number chomp($count); # chop off trailing \n char } for ($i = 1; $i <= $count; $i++) { print "$i \n"; }