#! perl -slw use strict; use IO::File; use threads; use Thread::Queue; sub thread{ my $Q = shift; my $fno = $Q->dequeue; open FH, "<&=$fno" or die $!; print for ; return; } my $Q = new Thread::Queue; my $thread = threads->create( \&thread, $Q ); my $io = IO::File->new( 'junk', 'r' ) or die $!; $Q->enqueue( fileno $io ); $thread->join; $io->close; __END__ P:\test>395373 This is junk and some more junk and yet more junk this is line 4 of junk