NewtownGuy
Technical User
I'm a newbie so please forgive this simple question.
I'm trying to launch a perl script on an Apache/2.0.49 HTTP server on Fedora Core 2 or a similar version on Fedora Core 3. I want the script to output the data that is sent to it by the web browser out the COM / ttyS0 port on the machine that is running the HTTP server. I do not want any message printed on IE.
I get the error message:
...premature end of script headers: serialscript.pl
in error_log for the HTTP server, and I get Internal Server Error in IE.
I gather that I'm getting the error messages because I'm not returning anything to the browser, but I don't want the browser to print anything.
Here's how I invoke the script from the URL line of IE:
Here's my serialscript.pl:
How do I fix this ?
I don't get any error messages if I run:
./serialscript.pl
from the Linux command line from the folder with serialscript.pl in it, but I don't know how to pass parameters to the script from the command line. How do I do that ?
Thank you.
I'm trying to launch a perl script on an Apache/2.0.49 HTTP server on Fedora Core 2 or a similar version on Fedora Core 3. I want the script to output the data that is sent to it by the web browser out the COM / ttyS0 port on the machine that is running the HTTP server. I do not want any message printed on IE.
I get the error message:
...premature end of script headers: serialscript.pl
in error_log for the HTTP server, and I get Internal Server Error in IE.
I gather that I'm getting the error messages because I'm not returning anything to the browser, but I don't want the browser to print anything.
Here's how I invoke the script from the URL line of IE:
Code:
[URL unfurl="true"]http://192.168.192.94:8000/cgi-bin/serialscript.pl?value=1234[/URL]
Here's my serialscript.pl:
Code:
#!/usr/bin/perl
use CGI;
$cgi = new CGI;
$value = $cgi->param('value');
open(OUT, ">/dev/ttyS0");
print OUT $value;
close(OUT);
How do I fix this ?
I don't get any error messages if I run:
./serialscript.pl
from the Linux command line from the folder with serialscript.pl in it, but I don't know how to pass parameters to the script from the command line. How do I do that ?
Thank you.