Hello !!!
Thank you for correction of my script. This script runs perfectly,
but in this script i must direct path. I would like run script in all
directoties and don't rewrite path in script every time.
I have a lof of files in different directories:
Examples:
D:\conv\ESSD\YJCIS\YJCIS14136\TOC.doc;
D:\conv\ESNL\APNUM\APNUM2185\vvvv.pdf;
D:\conv\ESME\BULSCI\BULSCI2303\rrr.tex...
.........and so on....
Constant path is "D:\conv", doesn't change
%%%%
For example:
I must send from
D:\conv\ESSD\YJCIS\YJCIS14136\
selective "TOC.doc" file to
X:\sgml_db\ESSD\YJCIS\YJCIS14136\
Constant path is "X:\sgml_db", doesn't change, the same "\ESSD\YJCIS\YJCIS14136\" catalogue name.
and rename "TOC.doc" to "MMC1.doc";
if i have "vvvv.pdf" I rename "MMC1.pdf" and so on.....
My script must undestand "paths", I want sent file from
directory to the same directory, only change "D:\conv\" to "X:\sgml_db\" path.
What i must add to this script !!???
-
use strict;
-
use warnings;
-
use File::Copy;
-
use File::Path;
-
-
my $sDest = 'X:/sgml_db/ESSD/YJCIS/YJCIS14136/';
-
mkpath ($sDest, {verbose =>1});
-
copy('D:/conv/ESSD/YJCIS/YJCIS14136/bbb.doc', qq{$sDest/MMC1.doc}) or die "Could not copy: $!";
-
Thank you !
Viki