in reply to Re: dd related
in thread dd related


Hi,
Is there any difference between the backticks and the process open
which you have just demonstrated?
I mean, does perl internally implement it differently?
For eg. A backtick may be passed to the shell directly
while the open(as above) may be implemented using popen,
which involves creating a pipe, forking, and invoking
the shell.
Or does perl just execute the command and then provide you
with a line by line output as you read it.

Thanx
--
arc_of_descent

Replies are listed 'Best First'.
Re: Re: Re: dd related
by broquaint (Abbot) on Mar 27, 2002 at 13:28 UTC
    > Is there any difference between the backticks and the process open which you have just demonstrated?
    A quick glance over the perlipc manpage reveals they that are similar in intent. They both fork and execute the process, but open() ...
    ... gives you finer control of the whole process, letting you to kill off the child process early if you'd like.
    So you might use open() if you want to exit from the process early in order to avoid unnecessary overhead.
    HTH

    broquaint