Code Comments
Programming Forum and web based access to our favorite programming groups.Sean Davis <mailto:sdavis2@mail.nih.gov> wrote:
: suppose my form values are stored in variables
: $a =3D param('name')
: $b =3D param('age')
:=20
: Now I need to call a perl function wth $a, $b as parameters.
: My $string =3D "perl test.pl $a $b"
: system($string)
:=20
: This is wht I am using now. when I try=A0 eg: perl test.pl john =
12=A0=A0=A0
: It works. And the variables are bnided properly in cgi script. I
: cheked to make sure. Can=A0anyone suggest how i should proceed.
First we need to cover some basics. You should refrain from
using $a and $b as variable names. They are used in sort() and it
can get confusing as you progress as a programmer. Use meaningful
variable names, even for small test scripts. It's a good habit.
Avoid naming a script test.pl. It is a common name for scripts
and you may find yourself running some other program than you
intended. Also investgate the use of the "strict" and "warnings"
modules at the beginning of all your scripts.
Do you have access to the test.pl script? Can you change it?
If you can, I would advise not using an external system command
to run another perl script. There are numerous internal perl
methods available.
Without looking at the script I can't tell much. Show us some
example code including the source of test.pl.
HTH,
Charles K. Clarkson
--=20
Mobile Homes Specialist
254 968-8328
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.