RE: Dir Command to an array
The dir command has a /b switch that can be used to get just the
filenames which can be useful for this kind of thing.
If you literally just want an array with the result, then
my @allfiles = `dir * /s`;
should do the trick.
-----Original Message-----
From: andrewmchorney@xxxxxxx [
mailto:andrewmchorney@xxxxxxx]
Sent: Friday, October 28, 2005 2:18 PM
To: beginners perl
Subject: Dir Command to an array
Hello
I would like to execute a dir */s command in windows and save the output
into an array. I know I can do this in perl by doing executing the
following command in a perl script:
@allfiles = `find / -print`;
How can do this in windows:
Thanks,
Andrew
.
Relevant Pages
- Re: executing from command line
... if fact it's a way to run a command remotely. ... >> I have a perl script that i would like to run it on a windows server. ... >opening up a security hole on the remote machine when you do this. ... (comp.lang.perl.misc) - Re: perl in Windows: using the "Send To" folder and perl
... this is not strictly a Perl question but ... ... > marked are supplied on the command line to the executable i.e. ... > I create my executable by writing a .bat file which in turn supplies ... You do not mention which Windows command shell you are using. ... (comp.lang.perl.misc) - Re: 500 Cant connect to search.cpan.org:80 (Bad protocol tcp) at web.plline 24.
... :>I beg to differ... ... be interpreted as an internal Perl command or a shell one). ... : of Windows APIs capabilities. ... (comp.lang.perl.misc) - Re: SQLPlus with Perl
... knowledge of the Perl programming language. ... The stuff within qxis a UNIX command string. ... the sql to sqlplus. ... this by assignment to an array. ... (comp.lang.perl.misc) - RE: Could anyone please answer a simple PERL question.
... I have added a note regarding Windows XP at the end of it. ... I have assumed that you have installed the Active State perl with all the ... One way to get around this is to open a command window. ... You need to get to the "file types" section of windows - I'm in NT right ... (perl.beginners) |
|