Mr. Shawn H. Corey wrote:
Evyn wrote:
... how would
I keep the structure?
#!/usr/bin/perl
use strict;
use warnings;
use File::Basename;
use File::Copy;
use File::Find;
use File::Path;
my $SrcDir = '.'; # Set to the source directory
my $DstDir = 'c:\\Documents\\AudioDownloadsWaiting\\';
sub wanted {
if( m{ \.gar \z }msx ){
( my $dir = dirname( $File::Find::name ) ) =~ s{ \A $SrcDir
}{$DstDir}msx;
mktree({$dir]);
# Oops, this should be:
mktree([$dir]);
move( $File::Find::name, $dir );
}
}
find( \&wanted, $SrcDir );
__END__
--
Just my 0.00000002 million dollars worth,
Shawn
"For the things we have to learn before we can do them, we learn by doing them."
Aristotle
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/