grashoper has asked for the wisdom of the Perl Monks concerning the following question:
use File::Copy; use strict; use warnings; $dirpath="C:\\inetpub\\performancetesting\\output\\new\\mlx\\aar"; $dirpath2="c:\\temp"; opendir(IN,"$dirpath") or die "opening directory failed:$!"; while (defined ($file = readdir(IN)) ) { @files=split / /,$file; foreach $filename (@files) { Copy (INPUT, "$dirpath".$filename, "$dirpath2".$filename) or warn "Can +'t open the file yet $filename\n:$!"; until (eof(INPUT)) { chomp($line = <INPUT>); # print contents of the file or do anything print "$line"; } } } closedir(IN);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: file copy undefined?
by ikegami (Patriarch) on Apr 14, 2009 at 16:02 UTC | |
|
Re: file copy undefined?
by kennethk (Abbot) on Apr 14, 2009 at 15:58 UTC | |
by grashoper (Monk) on Apr 14, 2009 at 16:27 UTC | |
by kennethk (Abbot) on Apr 14, 2009 at 16:32 UTC | |
by FunkyMonk (Bishop) on Apr 14, 2009 at 16:55 UTC | |
by grashoper (Monk) on Apr 14, 2009 at 17:22 UTC | |
|
Re: file copy undefined?
by ikegami (Patriarch) on Apr 14, 2009 at 16:15 UTC | |
|
Re: file copy undefined?
by FunkyMonk (Bishop) on Apr 14, 2009 at 16:12 UTC | |
|
Re: file copy undefined?
by linuxer (Curate) on Apr 14, 2009 at 17:52 UTC |