Here's a little code snippet that could be modified to suit your needs.
use Win32::OLE qw(in with);
use File::Basename;
my ($FileName, $folder, $ext);
opendir(NT, $folder) || die "Didn't find folder";
foreach $FileName (sort readdir(NT))# list context, sorted
{
On Sat, Sep 15, 2001 at 10:00:41AM -0700, Wagner-David wrote:
> while ( 1 ) {
>$filein = <*.txt>;
>last if ( ! defined $filein );
># other processing
> }
Or you could be a little more concise:
while ($filein = <*.txt>) {
# other processing
}
M
Could do a glob as:
while ( 1 ) {
$filein = <*.txt>;
last if ( ! defined $filein );
# other processing
}
Could do a readdir(ie, opendir, readdir).
Also use backticks and work with the output via say dir(ie, my @output = `dir`;)
Wags ;)
-Original Message-