in reply to Re^2: Copying files from a directory to cwd
in thread Copying files from a directory to cwd
use File::Copy; use File::Find; use strict; use warnings; my %files = map {$_ => 1} qw(data.txt datascript.pl); find(sub { copy($File::Find::name, '.') or die "Can't cp $File::Find::name: $ +!" if delete $files{$_}; }, 'C:\\files');
Update: change error message to display full path instead of just file name
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Copying files from a directory to cwd
by Anonymous Monk on Apr 21, 2011 at 05:40 UTC | |
by wind (Priest) on Apr 21, 2011 at 09:02 UTC | |
by Anonymous Monk on Apr 21, 2011 at 06:50 UTC | |
|
Re^4: Copying files from a directory to cwd
by Anonymous Monk on Apr 21, 2011 at 07:42 UTC | |
by Anonymous Monk on Apr 21, 2011 at 08:40 UTC |