in reply to pipe issue (linux)

I wonder if something like my @output = exec(script.pl); would work? Dont have linux currently installed so cant test anything on the linux side.

Replies are listed 'Best First'.
Re^2: pipe issue (linux)
by haukex (Archbishop) on May 05, 2016 at 20:23 UTC

    Hi james28909,

    From exec:

    The exec function executes a system command and never returns

    You're probably thinking of backticks aka qx, although that will also wait for the completion of the command before returning, so I don't think it'll help here. (BTW, a good alternative to qx is Capture::Tiny.)

    What might work is opening a pipe (Using open() for IPC) or using a module like IPC::Run (I haven't used the latter myself yet but it seems to be a good module).

    However, using those in the OP's line_process.pl won't fix the problem if dhcp_line_dispacher.pl is still buffering its output ;-)

    Regards,
    -- Hauke D