----- Original Message -----
From: McCormick, Rob E <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 21, 2001 12:08 AM
Subject: renaming files in a directory....
> I can print a file listing with this:
>
Try to do the rename in the while loopm cuz it loops over all the files in
the directory.
Better get your .pl script out of there tho or it will be .pl.txt.....
If you want a list like the example, you could try this:
> 1 #!c:/perl/bin/perl -w
> 2 use strict;
> 3 my @files
> 4 my $msds_files = "c:/winnt/profiles/myprofile/desktop/perl/test/"; #
> 5 opendir( MSDS, $msds_files ) or die "can't opendir $msds_files: $!";
> 6 while ( defined( $msds_files = readdir(MSDS) ) ) {
> 7 next if $msds_files =~ /^\.\.?$/; # skip . and ..
> 8 push @files, $msdn_files;
> 9 }
> 10
> 11 closedir(MSDS);
> 12
Then @files will be an array of filenames, in case you need it later on