Daniel Kurtz wrote:
Bob Showalter wrote:

Please tell me you're kidding.

Why? It works. The question asked how you can do it, not the BEST way
to do it. And after a week of Perling, this was the one way I knew.
Now I know two ways. <g>

OK, you weren't kidding. Since you're new to Perl, you get a free pass :~)

Seriously, though, not all of us run Perl on Windows. Your approach is Windows-specific. In addition, the "dir" command outputs a bunch of other stuff besides the file name, so you'd have to do some parsing to get the file names.

Either a glob approach or an opendir/readdir approach is simpler and more portable if one just needs a list of file names. If more details are needed, the stat() function (or related operators) can be applied to the resulting list.

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