On 8/8/07, Evyn <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have the following perl script that copies files from one folder to
> another:
>
> use File::Copy;
> my $filename = 'gar';
> for my $file ( <*.$filename> ) {
>     # copy each individual file
>     move($file, "c:\\Documents\\AudioDownloadsWaiting\\") or die "move
> failed: $!";
>     }
> print "Done";
>
> This works well, but now I need to look for .gar files in all the
> subfolders of the current folder too. How do I do this?
>
> Thanks for your time!
>
> Evan

Take a look  at File::Find*.  It allows you to deal with a directory
structure in a recursive manner.

* http://search.cpan.org/~nwclark/perl-5.8.8/lib/File/Find.pm

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


Reply via email to