Hi John Lin,

  you FIRST have to print the HTTP-Headers, and THEN everything else
follows. this might look a little something like this:


print "Content-Type: text/html\n\n";

open (COMHANDLE, '/usr/local/bin/gpg --no-tty --list-keys |') or die "can not list 
keys \n";
print <COMHANDLE>;
close (COMHANDLE) or die "can not close COMHANDLE \n";

....

"Content-Type: text/html\n\n";   <<< THIS is very important!
if you wish to show plain text only then write the following line:

print "Content-Type: plain/text\n\n";


AMEN!


> Hi list,

> I have written a perl CGI script that basically executes a system 
> command via an open command like so:

> open (COMHANDLE, '/usr/local/bin/gpg --no-tty --list-keys |') or die
> "can not list keys \n";
> print <COMHANDLE>;
> close (COMHANDLE) or die "can not close COMHANDLE \n";

> For some reason, if I run this CGI script in the command line, it 
> executes correctly (I get a list of keys in the shell).
> But when i try to run this script in a browser, nothing is printed in 
> the borwser.

> I have also tried with a simpler script that basically gets the system 
> date and output it like so:

> open (COMHANDLE, 'date |') or die "Can not get system date \n";
> print <COMHANDLE>;
> close (COMHANDLE) or die "Can not close COMHANDLE \n";

> But with this script, I can run it both in the shell and in a browser 
> and I get the system date.
> I am not really sure what the problem is at this time....  Any help is 
> welcome!

> Thank you all!

> John






--
mfg
 Alex                          mailto:[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to