What you really want to do is read the docs on CGI.pm.(perldoc -f CGI)
This explains how to get the info out of a query string, and what to do with it.
perldoc -f open explains how to open a file for output.
The rest, as they say, is a matter of piecing it together into a program.
Malk
*I lost my .sig. Do you have a spare?* | [reply] |
I know how to list the the content of 1.pl and I know how to list the content of filename.txt (using the querystring).
The problem is, I need the result of the execution of those two files combined.
http://www.someserver.com/cgi-bin/1.pl?filename.txt
The above line generates a menusystem, using data from filename.txt and putting it into a menusystem 1.pl
So what I need is the result of the execution put into another file.
| [reply] |
Ok, I apologise if I'm being overly dense, but I don't get what you're actually asking.
Executing the CGI as above would enable 1.pl to grab the filename, and use it to it's own nefarious ends.
If this file contains data for a menuing system, then the rest is merely generic programming.
If you need the data from the execution of 1.pl placed in another file, you can use string manipulation to add a prefix/other suffix to use filenam.txt as your root, so you know what the final file relates to.
If it's just a generic file, think of a name and open(F,">/blah/otherfile");print F "other data";close F;
Again, apologies if I've missed the point entirely, but this is simply where reading your specification of the problem leads my thinking.
Malk
*I lost my .sig. Do you have a spare?*
| [reply] |
I think some of the confusion here has to do with the way both
programs are to be executed. Here's what I think you want, and
here's how to do it. I'm assuming that the 1.pl program (a CGI)
is no available to you to modify (or this whole thing would be
alot easier :-D) So, you want 2.pl to execute 1.pl with a querystring.
Piece of cake.
use LWP::Simple;
$escaped_querystring = "something";
$output = get ("http://someurl/cgi-bin/1.pl?$escaped_querystring");
After this is executed $output will contain whatever 1.pl sent back
to the webserver for output, i.e., if it sent back an HTML page,
$output will contain the HTML page. You can write 2.pl to construct
your querystring to be anything you want, just make sure it's
escaped of all the nasty little HTTP characters and such. You can
use URI::Escape to do that.
Hope this helps.
Gary Blackburn
Trained Killer | [reply] [d/l] |
THANK YOU!
This is what I was looking for!
:o)
| [reply] |