Jan Dubois wrote:
On Mon, 03 Jan 2005, Sisyphus wrote:
Have you tried :
my $out = `cmd /C dir`;
No, I didn't - mainly because '/C' does not appear as an option in
'cmd command' under Windows Help. I did try a few other switches which
*were* mentioned there (such as '/c' and '/k') but they didn't wo
On Mon, 03 Jan 2005, Sisyphus wrote:
>>> Have you tried :
>>>
>>> my $out = `cmd /C dir`;
>
> No, I didn't - mainly because '/C' does not appear as an option in
> 'cmd command' under Windows Help. I did try a few other switches which
> *were* mentioned there (such as '/c' and '/k') but they didn't
Unfortunately, $out contains the output of running 'dir.exe'. How do
I code it so that $out captures the output of running the 'dir'
shell command, rather than the output of running 'dir.exe' ?
Have you tried :
my $out = `cmd /C dir`;
No, I didn't - mainly because '/C' does not appear as an option
On Mon, 03 Jan 2005, $Bill Luebkert wrote:
> Sisyphus wrote:
>
> > Suppose I have a file somewhere in my path named 'dir.exe' (that
> > prints "Gotcha!" when executed).
> >
> > I also have a perl script, in which I want to capture the output of
> > running the 'dir' shell command. So I write:
> >
>
Sisyphus wrote:
> Hi,
>
> Suppose I have a file somewhere in my path named 'dir.exe' (that prints
> "Gotcha!" when executed).
>
> I also have a perl script, in which I want to capture the output of
> running the 'dir' shell command. So I write:
>
> my $out = `dir`;
>
> Unfortunately, $out co