in reply to Directory Creation Routine
If you just are given the 'c:\dir1\dir2\dir3\myfile.txt' and 'd:\test' names and need to split off and reassemble the directory name, look at File::Spec.use File::Path "mkpath"; use File::Copy; eval { mkpath(['d:\test\dir1\dir2\dir3']); 1 } or warn "couldn't create path: $@"; copy('c:\dir1\dir2\dir3\myfile.txt', 'd:\test\dir1\dir2\dir3\myfile.txt');
|
|---|