Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Every path is different than the other, so I'm trying to pass it one by one to search for .htm files in each different directory. I get an error "useless use of private variable in void at test.pl line 37 Global symbol "$all_directories" requires explicit package name" My second issue is how do I rename files that are being copy to another directory dynamically without open and closing the directory that are being copy to?? Please Help!!! Here is my codec:\inetpub\test1 c:\inetpub\test2 c:\inetpub\test3
use File::Find; use File::Copy; my @directory = $all_directories; my @sourcefiles; my $srcfile; find(\&sourcefind, @directory); sub sourcefind { open(FL, $File::Find::name); push @sourcefiles, $_ if -f and /\.htm*/ ; close(FL); } foreach $srcfile (@sourcefiles) { copy( sub {print "$_ target found\n" if -f and /\Q$srcfile\E/;}, 'C:\temp'); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: rename files dynamically
by CountZero (Bishop) on Feb 24, 2003 at 16:16 UTC | |
by Anonymous Monk on Feb 24, 2003 at 16:47 UTC | |
|
Re: rename files dynamically
by hardburn (Abbot) on Feb 24, 2003 at 16:12 UTC | |
by Anonymous Monk on Feb 24, 2003 at 16:39 UTC | |
by hardburn (Abbot) on Feb 24, 2003 at 16:53 UTC | |
by Anonymous Monk on Feb 24, 2003 at 18:11 UTC | |
by pfaut (Priest) on Feb 24, 2003 at 18:20 UTC | |
|
Re: rename files dynamically
by Anonymous Monk on Feb 24, 2003 at 21:17 UTC |