in reply to Move a file to another directory based on regex match
The error message is strange, but I do see one issue with your code: readdir returns just the filenames without the directory name. I'd recommend you use File::Spec::Functions qw/catfile/; and move( catfile($InDir,$Infile), $OutDir ). If that fixes the issue, then perhaps the error message is just wrong (is this Windows or some OS other than *NIX?), and if it's doesn't fix the issue, please let us know Update: along with more information about $InDir and $OutDir. Also, Use strict and warnings!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Move a file to another directory based on regex match
by Corion (Patriarch) on Feb 25, 2021 at 15:16 UTC | |
by haukex (Archbishop) on Feb 25, 2021 at 15:25 UTC | |
by choroba (Cardinal) on Feb 25, 2021 at 17:12 UTC | |
|
Re^2: Move a file to another directory based on regex match
by DAN0207 (Acolyte) on Feb 25, 2021 at 16:58 UTC | |
by haukex (Archbishop) on Feb 26, 2021 at 08:11 UTC |