[Pdx-pm] Reading process output fails prematurely?

Eric Wilhelm enobacon at gmail.com
Thu Mar 5 10:16:42 PST 2009


# from Scott Garman
# on Thursday 05 March 2009 10:00:

>script works properly now, except that it buffers many lines (50+)
> from udevmonitor before I see them on the screen. Setting $| to 1 was
> no help, ... and I'm guessing that input
> buffering is what's causing me trouble).

Yes, pipes default to "block buffered".  So, you're seeing buffered 
output from udevmonitor.  You can either hack its source or try 
IO::Pty / IO::Pty::Easy -- emulate a terminal, which defaults to "line 
buffered".

--Eric
-- 
"If you dig it, it's yours."
--An old village poet (via Al Pacino)
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------


More information about the Pdx-pm-list mailing list