bh_perl has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have one question here....
How to copy file from original directory into other directory (if the files exists), example :
/tmp/LINE1.test.txt COPY TO /bh_perl/test.txt
Otherwise, this is my script and not working...
if ( -e "$bkpdir/$month/$month-$day/*$fname*" ) { copy ("$bkpdir/$month/$month-$day/*$fname*", $procdir/$fname") or warn ("Can't copy $fname\n"), die; } elsif ( -e "$arcdir/*$fname*" ) { copy ("$arcdir/*$fname*", "$procdir/$fname") or warn ("Can't copy $fname\n"), die; } else { print ("NOT FOUND $fname in \n bkpdir/$month/$month-$day/*$fname* + \n OR $arcdir/*$fname*\n"); }
Thank you,
bh_perl
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to copy files ?
by Limbic~Region (Chancellor) on Sep 08, 2003 at 04:52 UTC | |
Re: How to copy files ?
by mandog (Curate) on Sep 08, 2003 at 05:42 UTC | |
Re: How to copy files ?
by bradcathey (Prior) on Sep 08, 2003 at 12:25 UTC | |
by bh_perl (Monk) on Sep 10, 2003 at 08:30 UTC | |
Re: How to copy files ?
by Abigail-II (Bishop) on Sep 08, 2003 at 06:40 UTC | |
by dmitri (Priest) on Sep 08, 2003 at 23:02 UTC | |
Re: How to copy files ?
by Anonymous Monk on Sep 08, 2003 at 05:04 UTC |
Back to
Seekers of Perl Wisdom