Your operating system wants you to be more explicit than your shell wants you to be. You will need to construct the target name then from the directory and the filename:
use File::Spec; my $target_dir = 'TEST'; my $source = 'foo.txt'; my $target = File::Spec->catfile($target_dir, $source); rename $source => $target or die "Couldn't rename '$source' to '$target': $!";
In reply to Re^3: Rename not working
by Corion
in thread Rename not working
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |