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.

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>


Reply via email to