I have a CGI that writes to a text file. After writing to the text file, I want another CGI to run and index that text file along with all the others in the directory.
The writing and indexing work fine. The problem comes with what is returned to the client. This is what I have:
print<<EOF
text goes here
EOF
exec '/path/to/second/2.cgi' || $error($!);
print<<EOF
remaining text goes here
EOF
The 2.cgi should output plain text saying what it did between the text outputted by 1.cgi. But either i only get what 2.cgi outputs, or a 500 error.
The output from 2.cgi is:
print "Content-type: text/plain\n\n";
print "Done-Captured $number-files total\n";
2.CGI works fine on its own, and with the content-type header, displays from 1.cgi, though the text from 1.cgi will not.
Hope this is clear.
Any ideas how to get output from both 1.cgi and 2.cgi to show?
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.