in reply to How can i change the file extension?

Take a look at the 'rename' function (perldoc -f rename).
foreach my $file (glob '/path/*.txt') { (my $new_file = $file) =~ s{txt\z}{html}; rename $file => $new_file; }