The CGI spec specifies what you be on the command line, in the environment and on standard input. Among other things, it explicitely states "The command line is only used in the case of an ISINDEX query.", a type of request I haven't seen used since 1995.

Update: Untested:

my $response; { # Protect the parent script's environment. # I hope this doesn't remove %ENV's magic. local %ENV = %ENV; $ENV{SERVER_PROTOCOL} = 'HTTP/1.0'; $ENV{REQUEST_METHOD} = 'GET'; # To build URLs. $ENV{SERVER_NAME} = 'www.example.com'; $ENV{SERVER_PORT} = 80; $ENV{SCRIPT_NAME} = '/some_script.cgi'; # For /xxx.cgi/path delete $ENV{PATH_INFO}; delete $ENV{PATH_TRANSLATED}; # Unset these for POST. $ENV{QUERY_STRING} = 'blah=foo&larh=bar'; # Set these for POST. delete $ENV{CONTENT_TYPE}; delete $ENV{CONTENT_LENGTH}; $ENV{REMOTE_ADDR} = '127.0.0.1'; # Need to place data on child's STDIN for POST. # Need to place data on paramater line for ISINDEX queries. $response = `perl some_script.cgi`; }

In reply to Re: CGI from another script by ikegami
in thread CGI from another script by rsiedl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.