in reply to
Capture output from system commands
Try
$text->insert('1.0', qx[$got])
.
Comment on
Re: Reading from the screen
Download
Code
Replies are listed 'Best First'.
Re: Re: Reading from the screen
by
Anonymous Monk
on Nov 18, 2003 at 02:42 UTC
thanks, it worked, but could you explain how qx does it?
[reply]
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 /;
[download]
is equivalent to
$n = `$got`;
[download]
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.
[reply]
[d/l]
[select]
In Section
Seekers of Perl Wisdom