Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-09-2007, 12:18 AM   #1
LQ Newbie
Registered: Oct 2007
Posts: 26

Rep: Reputation: 15
how to pass in a parameter to a perl script


i'm having a problem a problem where i'm trying to call a perl cgi script from another perl cgi script and i want to pass in parameters with the call.

i've something very similar which works: if i have a html link with "<a href..." then in this link i can pass in parameters in the manner: "myscript.cgi?name=value" and i'm able to read 'name' in myscript.cgi.

however, problem occurs when i cannot have a link because i don't want the user to click on anything and basically, at a certain point in my perl cgi script i want to transfer control over to another perl cgi script. so to do this, i am using the system command in the manner:

system("/usr/bin/perl myscript.cgi?name=value"
this causes a HTTP 500 error on the browser. i've tried to look up examples on how to do this but i'm still kind of at a loss on understanding how to do this. any guidance will be infinitely helpful. thanks!
Old 12-09-2007, 12:37 AM   #2
Registered: Jul 2006
Location: FL, Delray Beach
Distribution: Slackware11, LFS
Posts: 67

Rep: Reputation: 15
you can do that via global values, you can load up all you necessary data into hash and then load that globally declared hash into any script. if you can provide me with 2 examples, and what are you trying to pass to another script, i might help you, and give you examples on how to pass hash to another script.
Old 12-09-2007, 12:48 AM   #3
LQ Newbie
Registered: Oct 2007
Posts: 26

Original Poster
Rep: Reputation: 15
i've a username scalar variable, about which i want to know in any script that i'm in. i'm somewhat familiar with global varialbes in perl. does this just mean that i need to declare an 'our' hash? but how do i access this then? thanks for your help.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass command-line parameter to shell script? Kropotkin Linux - Newbie 12 07-25-2011 09:24 AM
Testing parameter input to perl script merana Programming 1 03-17-2006 09:54 AM
gtk - How to pass in a parameter Ian D Programming 4 10-28-2005 11:23 AM
how do I pass a module parameter? maerong Debian 2 02-07-2005 07:33 AM
PHP Pass Parameter Gerardoj Programming 2 05-25-2004 08:12 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:15 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration