in reply to Re: Reading from the screen
in thread Capture output from system commands

thanks, it worked, but could you explain how qx does it?

Replies are listed 'Best First'.
Re: Re: Re: Reading from the screen
by Roger (Parson) on Nov 18, 2003 at 02:56 UTC
    The 'qx' keyword is just another way to write the back quote (`). The code -
    $n = qx/ $got /;
    is equivalent to
    $n = `$got`;
    What it does is to execute the $got command, and capture its output to a scalar.

    You should have a look on CPAN perlop under the section "Quote and Quote-like Operators".

    Update: Thanks to ysth to point out my typo.