Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to send info by post from one script to another, how might i approach this.
  • Comment on sending post info from one script to another

Replies are listed 'Best First'.
RE: sending post info from one script to another
by ferrency (Deacon) on Jul 27, 2000 at 19:28 UTC
Re: sending post info from one script to another
by davorg (Chancellor) on Jul 27, 2000 at 19:18 UTC
RE: sending post info from one script to another
by jlistf (Monk) on Jul 27, 2000 at 19:34 UTC
    it seems (once again) that someone is looking for the elusive and wily CGI.pm module. check it out at CPAN. to send info, the best way seems to be form data. use either hidden fields or user-typed fields, depending on what data you're sending. to get this data back, use the param method from CGI.pm. check out the documentation for more info.

    i can see jacque cousteau doing a special on this. <in a french accent> "we are here to search for ze wily and elusive CGI.pm. we must travel to the farthest reaches of CPAN to find zis mysterious beast. Oooh! Look, a glimpse of ze majestic creature."
RE: sending post info from one script to another
by infinityandbeyond (Sexton) on Jul 28, 2000 at 06:47 UTC
    A complete solution.

    script1.cgi

    #!/usr/bin/perl use CGI; my $cgi = new CGI; print $cgi->header(); print <<EOM; <form method="post" action="script2.cgi> <input type="submit" name="Name" value="Value"> </form> EOM

    script2.cgi

    #!/usr/bin/perl use CGI; my $cgi = new CGI; if ($cgi->param('Name') eq 'Value') { #your code here ... refer to by $cgi->param('var') }
    And this is perl, and other people have other ways of doing it.