Hello, Marc,
this works:
- snip --
use Event;
die "Usage: $0 <filename>\n" unless @ARGV and -e $ARGV[0];
my $fh = do { local *GLOB };
open $fh, "<", $ARGV[0] or die $!;
print "fileno: ", fileno $fh, "\n";
print "asstring: $fh\n";
# here is the difference
Event->io(fd=>\$fh, cb=>\&callback);
Event::loop;
# demo callback
sub callback
{
my ($event)=@_;
my $ifh=$event->w->fd;
my $line=<$ifh>;
print $line;
Event::unloop if eof($ifh);
}
- snip --
Greetings
Jochen
- Event->io does not accept GLOB refs Marc Lehmann
- Re: Event->io does not accept GLOB refs Jochen Stenzel
- Re: Event->io does not accept GLOB refs Marc Lehmann
- Re: Event->io does not accept GLOB refs Graham Barr
- Re: Event->io does not accept GLOB refs Mike Guy
- Re: Event->io does not accept GLOB refs Marc Lehmann
