> -----Original Message-----
> From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 26, 2005 11:27 AM
> To: Daniel Kurtz
> Cc: beginners@perl.org
> Subject: Re: Need a list of files in a dir.
> 
> Please bottom post...
> 
> Daniel Kurtz wrote:
> > Ooh ooh ooh! One I know!
> >
> > open(COMMAND, "dir |");
> > @files = <COMMAND>;
> >
> 
> Sort of, while that *may* work it doesn't have proper error checking,
is
> less secure, less efficient, and less portable than many other ways,
> especially those already provided.
> 

I agree.  Though I'm still a novice, I have already applied Perl scripts
to several tedious tasks that I have.  These include searching file
systems for this, that, and the other file.  A good resource is
O'Reilly's Perl for System Administration, Ch. 2 Filesystems.  In
demonstrates modules such as Cwd and File::Find that work great in
scouring your filesystem.

And of course, don't forget to search CPAN; lots of good stuff.

> This is my same rant as in the past, check the archives if you want
the
> real details, but shelling out is an *absolute* last resort. Perl
> provides built-in functions to handle this, in cases where it does it
is
> never faster, safer, or more portable to shell out.
> 
> http://danconia.org
> 
> 
> > Daniel
> >
> > -----Original Message-----
> > From: Luinrandir [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, August 25, 2005 21:33
> > To: beginners@perl.org
> > Subject: Need a list of files in a dir.
> >
> >
> > How do I get the list of files in a DIR and put in an array?
> >
> > I'm drawing a blank on my search for this.
> >
> > thanks
> > Lou
> >
> >
> >
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to