Mailing List Archive

setio
How come Fnctl.pm doesn't have an F_SETOWN export?

Also, is this supposed to work?

#!/usr/bin/perl -w
use FileHandle;
use Fcntl;
BEGIN {
if (!defined &F_SETOWN) {
require 'sys/fcntl.ph';
}
}
use strict;
my $readme = 0;
STDOUT->autoflush();
$SIG{IO} = sub {
$readme++;
warn "hey, you have some io to attend to!";
};

fcntl(STDIN, &F_SETOWN, $$)
|| die "can't setown stdin: $!";

do {
print "sleeping...";
sleep 10;
} until $readme;

print "reading...";
print scalar <STDIN>;
print "done\n";


I haven't done any SIG IO stuff for so many years that
I don't quite recall how it works.

--tom


: =09wow
: =09=E0=E9
Gad, I hate MIME.
--Larry Wall in <9509111657.AA04720@scalpel.netlabs.com>