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

Instead of dirname( $File::Find::name ) why not $File::Find::dir?


}{$DstDir}msx;
   mktree({$dir]);
   move( $File::Find::name, $dir );
 }
}

find( \&wanted, $SrcDir );


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to