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
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.