#!/usr/bin/perl use warnings; use strict; my $count = 0; if( $ARGV[0] ){ $count = $ARGV[0]; }else{ print "Enter integer to count to, and press return\n"; $count = <>; chomp $count; } for(0..$count){ print "$_\n"; }