Discussion Locked

Pass arguments to Perl from CGI

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a CGI script "start.pl" that collects a bunch of information via a form (i.e. $query->param('username')). Upon SUBMIT I want to reload the "start.pl", but (in the background), pass the 'username' parameter to another script "runme.pl". Runme.pl will be using the parameter as an argument in a system() call.
I don't want any of the output from runme.pl to appear my web pages at all.
I tried using the "do", "eval", "system" functions but none seem to do what I want. I am able to use "do" to start the other script but cannot figure a way (short of writing to a text file) to pass the parameter on.
Any ideas?

5 replies

by tymitche

Perhaps I should mention that I can start RUNME.PL find from the command line, with my parameters strung on after it and using the $ARGV[n] function to grab the parameters. But when I tried something similar from START.PL it doesn't work.
i.e:
system ($commandline,$argument);

by lo

Might try creating enviroment variables before you run runme.pl and reading them (and deleting?) from the runme.pl application.

by tymitche

Lo, I know where you are coming from but that is not really what I need. I was looking more for the proper method for passing a variable from one script to another. I have since learned that I "need" to use Object Oriented procedures to make my life easier.

This discussion is closed to new replies.