Lightning flashed, thunder crashed and "Ackim Chisha" <[EMAIL PROTECTED]> whis
pered:
| Now I need to display the output of a system command to HTML. It can't =
| seem to work I don't know why. Here is what am trying to do,
| 
| Am running the following command,
| 
| $command =3D 'pgp -kv' ;
| 
| system($command) ;
| 
| Print "system($command)"; =20
| 
| This is to make perl send the output to HTML so it can display the =
| listing of pgp keys. it doesn't work,  do I need to send the output to a =
| file and the display the output into an HTML format.
| 
| Or what is the better way of sending an output  of a system command to =
| HTML?

You need to use the backticks and capture the output.  system() runs a
command and returns the return code (usually 0 for correct run, something
else for a failure).  On the command line, if there is output, you'll
probably see it on STDOUT (your screen).  The backticks do much the same as
system() except that the output of the command is what is returned.

So, try:

$command = 'pgp -kv';
$output = `$command`;
print "The output is: \n";
print $output;

-spp
--
Stephen P Potter                                         [EMAIL PROTECTED]
"You can't just magically invoke Larry and expect that to prove your point.
Or prove that you have a point."        -Simon Cozens
UNIX, Perl, PHP, Web Consulting and Training  http://www.unixlabs.net/~spp/


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

Reply via email to