469,325 Members | 1,617 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,325 developers. It's quick & easy.

Perl system call - passing parameters in url

Hi

I have a script called test.pl which calls another script using system

The problem is in test.pl I want to call

system("stockroom.pl?stkid=23&pn=17Z78&sn=12345678 90")

But this does not work?

It will alllow me to call system("stockroom.pl") but I cant seem to be able to pass parameters using the designation above?? or How do I pass these parameters correctly

Should I use another command like exec, require or redirect??

All advice and info greatly received??

Thanks Liachta (newbie)
Jan 17 '08 #1
2 6529
prn
254 Expert 100+
Hi LIachta,

You can pass parameters using system, but you are trying to do it as if you were calling a web page rather than using system conventions. Normally parameters are passed to programs on your computer separated by spaces. The "?" is used in a URL when you are passing parameters from a web browser.

Now, there is another thing here too. What do you expect to get back from stockroom.pl? I am guessing that test.pl is a web application and you are accessing it via a web server. Is that correct? If test.pl expects to get data back from stockroom.pl so that it (test.pl) can process the data and serve it back to the browser, then you have one sort of situation. OTOH, if you just want to hand off the parameters to stockroom.pl and let it interact with the browser, then test.pl should redirect the browser to stockroom.pl with the parameters as you have listed them.

Of course, the way that stockroom.pl handles the parameters will depend on whether it is getting those parameters from a web server or from the shell. If stockroom is supposed to be more of a "backend" program that will hand data back to a cgi script, then you should probably rewrite it as a perl module (and rename it stockroom.pm). I don't think I can answer any of those sorts of questions without a much better idea of what you are doing or trying to do.

Best Regards,
Paul
Jan 17 '08 #2
you can put whole thing into one variable.

like
$var="file.pl para..para1..para2";
system($var);
you can try this.
Hi

I have a script called test.pl which calls another script using system

The problem is in test.pl I want to call

system("stockroom.pl?stkid=23&pn=17Z78&sn=12345678 90")

But this does not work?

It will alllow me to call system("stockroom.pl") but I cant seem to be able to pass parameters using the designation above?? or How do I pass these parameters correctly

Should I use another command like exec, require or redirect??

All advice and info greatly received??

Thanks Liachta (newbie)
Jan 22 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by AznCollegeGuy | last post: by
3 posts views Thread by Samarth | last post: by
reply views Thread by Kirt Loki Dankmyer | last post: by
8 posts views Thread by =?Utf-8?B?UmF2aQ==?= | last post: by
5 posts views Thread by Johann C. Rocholl | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.