Wiggins d'Anconia wrote:
Please bottom post...

Daniel Kurtz wrote:

Ooh ooh ooh! One I know!

open(COMMAND, "dir |");
@files = <COMMAND>;



Well, there's two methods that I use where I can and they are probably more portable.

glob works well most of the time:
@files = </directory/goes/here/*>;
But it has problems with large numbers of files. And the problems will cause it to fail badly.

The other is to opendir and read in a loop.

In either case you need to remove the '.' and '..' entries:

@files = grep {! /^\./} </directory/goes/here/*>

or something like that.

I should warn you, not only is this untested code, but I haven't even had my coffee yet.

--
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