##
C:> script.pl >log_file.txt
####
C:> perl script.pl >log_file.txt
####
#!/usr/bin/perl -w
if (!defined $ARGV[0]) {$ARGV[0] = 3};
print "Argv[0] is $ARGV[0] \n";
print "Just a line to see what happens\n";
# Just to make it fun
$less = $ARGV[0] - 1;
if ($less)
{
print "Call with one less: $less \n";
system ("script.pl $less");
print "System returned $? (not that I care!)\n";
}