in reply to Re^2: Rename not working
in thread Rename not working
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': $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Rename not working
by drodinthe559 (Monk) on Jul 21, 2008 at 19:33 UTC |