Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
when I run this script from the command line, as follows -#!/usr/bin/perl -w use strict; $|++; use CGI; my $cgi = CGI->new; my $number = $cgi->param('number'); print "param: ".$number."\n"; my $n; print "Command line reporter\n";print "Called with ",$#ARGV+1," parameters which ", @ARGV == 1 ? "was" : "were" ,"\n";print (++$n,": $_\n") foreach (@ARGV) ; for(my $i=0;$i<$number;$i++) { print("*\n"); sleep 1; }
param: 4 Command line reporter Called with 1 parameters which was 1: number=4 * * * *
exec '/usr/bin/perl', '-T', 'child.pl', 'number=10' or die "Cannot execute : $!";
Use of uninitialized value in concatenation (.) or string at child.pl +line 10. param: Command line reporter Called with 1 parameters which was 1: number=10 Use of uninitialized value in numeric lt (<) at child.pl line 17.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing Args via Exec
by superfrink (Curate) on Aug 28, 2004 at 01:54 UTC | |
by Anonymous Monk on Aug 28, 2004 at 10:14 UTC | |
by Anonymous Monk on Aug 28, 2004 at 11:52 UTC | |
by Anonymous Monk on Aug 28, 2004 at 19:01 UTC | |
|
Re: Passing Args via Exec
by El Linko (Beadle) on Aug 28, 2004 at 00:10 UTC | |
by Anonymous Monk on Aug 28, 2004 at 00:23 UTC | |
by Anonymous Monk on Aug 28, 2004 at 01:28 UTC |