I am having problems renaming files in a directory. I want to rename files for instance c:\folder\files\tree.txt
to only 'tree'. Here is a snippet of what I'm working with. Help, please.
use strict;
my $dir = 'C:\duty\tasks\checks';
my @file = glob "$dir/file*9*";
my $word;
foreach $word(@file) {
print "One of the files is $word\n";
}