sub read { my $CLASS_HPLOO ; $CLASS_HPLOO = $this if defined $this ; my $this = UNIVERSAL::isa($_[0],'UNIVERSAL') ? shift : $CLASS_HPLOO ; my $class = ref($this) || __PACKAGE__ ; $CLASS_HPLOO = undef ; my $timeout = shift(@_) ; $timeout = -1 if $timeout eq '' ; open (my $fh, $this->{OUTPUT_R} ) ; binmode($fh) ; seek($fh , ($this->{OUTPUT_R_POS}||0) , 0) ; my $time = time ; my ($x,$data) ; while( $x == 0 || (time-$time) <= $timeout ) { ++$x ; my $s = -s $this->{OUTPUT_R} ; my $r = read($fh , $data , ($s - $this->{OUTPUT_R_POS}) , length($data) ) ; $this->{OUTPUT_R_POS} = tell($fh) ; last if !$r ; } close($fh) ; my @lines = split(/(?:\r\n?|\n)/s , $data) ; return @lines if wantarray ; return join("\n", @lines) ; }