I'm trying to capture data from a linux device file; in the form:
------------------------------#!/../../perl -w open(FF, "< /dev/mouse") || die "cannot open handle \n"; while (<FF>) { $vr = $_; print $vr; } close (FF);
I keep getting the error "readline() on closed filehandle FF on line 3"
I've tried this with /dev/ttyS1 , /dev/usb/USB/scanner0 and /dev/fd0
This works fine if I use a test file, like :
Also, I tried this in the form: sysopen(FF, "/dev/fd0", O_RDONLY); but I always get the error that says "item O_RDONLY isn't numeric at line 3"open(FF, "< /path/to/file.txt" );
Why doen't the sysopen work ? why does the device file always seem closed or non-existent ?
I am using Linux 9 and Perl 5.8 . I would hope not to need any Perl modules for something this basic... Help Help..... Happi..
Edited by Chady -- code tags and minor formatting.
In reply to Linux device filehandle roadblock by happi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |