tel2 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I've got a Perl script (script1.pl) which, amoung other things, does:
do 'script2.pl';
script1.pl is called from a web browser to create a web page.
What are my options for passing a parameter to script2.pl?
I've tried things like:
do 'script2.pl 123';and
do 'script2.pl&var1=123';but they both don't work (they don't give an error message, but script2.pl doesn't get run).
Until now, I've been working around this by doing:
our $var1 = 123;before the 'do' command. Is there a better way to pass a parameter to script2.pl with 'do'?
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: do script2.pl with parms
by Corion (Patriarch) on Nov 12, 2010 at 08:33 UTC | |
|
Re: do script2.pl with parms
by cosimo (Hermit) on Nov 12, 2010 at 09:39 UTC | |
by afoken (Chancellor) on Nov 12, 2010 at 13:44 UTC | |
by GrandFather (Saint) on Nov 12, 2010 at 22:02 UTC | |
|
Re: do script2.pl with parms
by tel2 (Pilgrim) on Nov 12, 2010 at 22:36 UTC | |
|
Re: do script2.pl with parms
by tel2 (Pilgrim) on Nov 12, 2010 at 09:23 UTC | |
by Corion (Patriarch) on Nov 12, 2010 at 09:51 UTC |