Normally you structure your code a little better. When CGI stuff "does not work" you should check the error logs which usually indicate *why* it does not work. See CGI Help Guide and particularly the bit about error_log. Assuming that admin.pl uses the CGI module and is in the same dir as the calling script then this should work:

exec( "./admin.pl msg=Success" );

script?some=arg syntax is HTTP syntax, not OS calling syntax. You have to use syntax your OS understands. Alternatively your newComp.pl script could do this:

use CGI; my $q = new CGI; # do stuff, generate message print $q->redirect( "http://domain.com/cgi-bin/admin.pl?msg=$MESSAGE" +);

If your scripts are not using CGI then you should probably start now. use CGI or die. I would suggest moving the functions or both scripts into a module(s) and then just having the scripts call the module functions. This is much more flexible. See Simple Module Tutorial

cheers

tachyon


In reply to Re: running a CGI script from another CGI script by tachyon
in thread running a CGI script from another CGI script by poprishchin

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.