in reply to Re: dumb question on exec and system ...
in thread dumb question on exec and system ...

And even if none of these stand, qx captures and saves the output in memory, thus it can eat too much memory unneccessarily if you discard the output. (A make command can have several megs of output to stdout.)

  • Comment on Re: Re: dumb question on exec and system ...

Replies are listed 'Best First'.
Re:: dumb question on exec and system ...
by Abigail-II (Bishop) on Apr 15, 2004 at 16:55 UTC
    And even if none of these stand, qx captures and saves the output in memory, thus it can eat too much memory unneccessarily if you discard the output.
    Uhm, no. Testing seems to indicate qx// is context aware, and doesn't store anything in void context. Running:
    perl -wle '`perl -le "print q!*! x 1_000_000 while 1"`'
    doesn't consume much memory, but running
    perl -wle '$_ = `perl -le "print q!*! x 1_000_000 while 1"`'
    quickly consumes all memory available.

    Abigail