in reply to copy directories

Here's the deal - your are breaking all kinds of rules.
Not the rules you are suppose to break either.

USE STRICT!!

Having said that, here is my interpretation of your code. I took the liberty of only allowing unix style paths in the list file - they do not contain trailing slashes.
use strict; use IO::File; use File::Find; use File::Copy; &USAGE,exit unless my ($file,$list) = @ARGV; #open data for user file my $LIST = new IO::File($list) or die "Cannot open user : $!\n"; my @DIR = <$LIST> or die "List file is empty!\n"; $LIST->close; foreach my $target (@DIR) { chomp $target; find sub { return if /^\./; if (-f) { print "cp $_ $target/$_\n"; #copy($_,"$target/$_"); } elsif (-d) { print "mkdir $target/$_\n"; #mkdir("$target/$_",0711); } }, $file; } sub USAGE { print "Usage: perl sendfile.pl <file(s)> <group list>\n" }
But alas, it does not work. The problem is remembing what path to copy to - File::Find will handle recursing into the source directory, but how do you maintain a synchronized recursing into the target directory?

So, since I can't solve your problem I will re-ask the monks:

What is the best way to mirror a directory tree using Perl?

Jeff

R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--