Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Reposting a running code...I am getting the following error while running the following code,even if I change "\" to "/",I see the same error.Can anyone pls advise?
OUTPUT:- Can't cp C:\sensors/data.txt: at Test_script.pl line 19. #!/usr/bin/perl -w use strict; use warnings; use Net::Telnet; use Net::FTP; use File::Copy; use File::Find; my $dir; $dir=$ARGV[0]; opendir(DIR, "$dir") || die "Error in opening dir $dir $!"; print "\n$dir\n"; 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{$_}; }, $dir); close DIR;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error while Copying files from a directory to cwd
by wind (Priest) on Apr 21, 2011 at 15:04 UTC | |
|
Re: Error while Copying files from a directory to cwd
by InfiniteSilence (Curate) on Apr 21, 2011 at 14:55 UTC | |
by Anonymous Monk on Apr 21, 2011 at 15:03 UTC | |
by Anonymous Monk on Apr 21, 2011 at 17:26 UTC | |
|
Re: Error while Copying files from a directory to cwd
by Anonymous Monk on Apr 21, 2011 at 15:53 UTC |