My sysopen fails:
sysopen(DEV, "/dev/ttyS0", O_NONBLOCK|O_RDONLY)
returns 1, which is a success! Then, why does $! have the error "Illegal seek" in it (where it is undef before the call)
before sysopen $!:
after sysopen $!: Illegal seek
EDIT: Here is the full script: (using the actual O_NONBLOCK|O_RDONLY value 2048)
#!/usr/bin/perl -w
use Device::SerialPort;
my $ob;
$ob = new Device::SerialPort("/dev/ttyS0");
print $!, "\n";
$! = 0;
my $ret = sysopen(DEV, "/dev/ttyS0", 2048);
print $!, "\n";
$! = 0;
print "ret from sysopen: ", $ret, "\n";
#my $dev = <DEV>;
which prints out: ./filehandle.pl Illegal seek Illegal seek ret from sysopen: 1