I hope this will give you a better understanding of how my script is
running:
#!/usr/bin/perl
use strict;
use CGI qw/:standard/;
print header( -status => '204 No Content' );
open(CU, '/usr/bin/cu');
print(CU "-s 9600 /dev/term/a\n");
close(CU);
open(DEV, '>>/dev/term/a') or die "Couldn't open serial device:$!\n";
{my $prevh = select DEV; $|=1; select $prevh;
}
# enter the serial port where the camera
# device is located here
print "Perl LABCAM console - Please insert what camera you would like to
view or the amount of cameras you would like to see on screen: \n";
$camera=<stdin>;
if ($camera==1){
print "You chose camera $camera\n";
print(DEV "@"),
select ( undef, undef, undef, 0.09 ),
print(DEV "0"),
select ( undef, undef, undef, 0.09 ),
print(DEV "1"),
select ( undef, undef, undef, 0.09 );
}
- Does anything seem not right? Is there a way to make it redirect to the
same page?