chunlou has asked for the wisdom of the Perl Monks concerning the following question:
and$output = qx/ls/ ; print $output ;
(except that WScript will use \r\n instead of \n as end of line).use Win32::Script qw/WScript/ ; $output = WScript('Shell')->Exec("ls")->StdOut->ReadAll ; print $output ;
and<SCRIPT language="PerlScript"> $output = qx/ls/ ; $window->document->write($output) ; </SCRIPT>
qx returned nothing, whereas WScript worked as expected. If I do:<SCRIPT language="PerlScript"> use Win32::Script qw/WScript/ ; $output = WScript('Shell')->Exec("ls")->StdOut->ReadAll ; $window->document->write($output) ; </SCRIPT>
output.txt would be created with results in it, so I know qx did execute the command.<SCRIPT language="PerlScript"> qx/ls > output.txt/ ; </SCRIPT>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: qx vs WScript: Why didn't qx work in my ActiveState's PerlScript?
by jkahn (Friar) on Sep 11, 2002 at 21:52 UTC | |
by dws (Chancellor) on Sep 11, 2002 at 22:05 UTC | |
by chunlou (Curate) on Sep 11, 2002 at 22:57 UTC | |
by helgi (Hermit) on Sep 12, 2002 at 09:51 UTC | |
|
Re: qx vs WScript: Why didn't qx work in my ActiveState's PerlScript?
by Solo (Deacon) on Sep 11, 2002 at 23:04 UTC |