in reply to Re: help moving files
in thread help moving files

The following is some hastily bashed together code to show what I mean. It works for me but you should add error handling etc.
#!/usr/bin/perl use warnings; use File::Copy; use File::Find; find(\&wanted, 'c:\\Pete'); sub wanted { if ($File::Find::name =~ /\.pl$/) { my $copyname = "c:\\folderb/$_"; print "Copying $_ from $File::Find::dir to $copyname\n"; copy("$File::Find::name","$copyname"); } }
It finds all the .pl files in c:\Pete and sub-directories and copies them into c:\folderb.

Look at the documentation to find out about the special variables that are available to the subroutine.

Hope this helps.