Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: file copy undefined?

by grashoper (Monk)
on Apr 14, 2009 at 17:22 UTC ( [id://757438]=note: print w/replies, xml ) Need Help??


in reply to Re^3: file copy undefined?
in thread file copy undefined?

yeah it should have had slashes thanks, now it does copy all the files in the dir, however I still get a cannot open the file yet but now its only happening twice, what is causing this error message is it trying to copy . and ..? apparenty that is what its doing, how do I get rid of it..I tried this but it didn't work I know its only happening because of the warning, but I want to get rid of it as it isn't really an error. not sure how to incorporate grep here..
use File::Copy; #use strict; my $dirpath="C:\\inetpub\\performancetesting\\output\\new\\mlx\\aar\\" +; my $dirpath2="c:\\temp\\"; opendir(IN,"$dirpath") or die "opening directory failed:$!"; while (defined (my $file = readdir(IN)) ) { push (my @files, $file); foreach my $filename (@files) { copy ("$dirpath".$filename, "$dirpath2".$filename) or warn "Can't open + the file yet $filename\n:$!"; need something like my @files=grep { $_ ne '.' && $_ ne '..'} } } closedir(IN);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://757438]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-23 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found