Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

RE: [NOVICE] calling perl program within a cgi script with parameters from html form
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



Report this thread to moderator Post Follow-up to this message
Old Post
Charles K. Clarkson
04-27-05 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL CGI Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:35 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.