Hello,
Sorry to ask this, as I am quite new at this.
And the online class that I am just now finishing has
lots of bad code for examples!
>From this list:
print "'$file' => '$newfile'\n";
^^^^^^^^^
What does this line mean, this a renaming convention?
Thanks
Dave
--------------
while (defined(my $file = readdir(MSDS)))
{
next if $file =~ /^\.\.?$/; # skip ".", ".."
next if $file =~ /\.pl$/; # don't want to rename Perl script
my $newfile = $file . ".txt"; # or whatever
print "'$file' => '$newfile'\n";
# rename($file, $newname)
# or warn "Couldn't rename '$file' => '$newfile': $!\n";
}