in reply to Re: New Perl programmer looking for answer in Directory Comparisons
in thread New Perl programmer looking for answer in Directory Comparisons
use File::Copy; use File::Basename; for $base (map basename $_, map glob "$_/*", @ARGV) { my ($src, $dst) = map "$_/$base", @ARGV; -f $src and not -e $dst and not copy $src, $dst and warn "copy $src +to $dst failed"; -f $dst and not -e $src and not unlink $dst and warn "unlink $dst fa +iled: $!"; }
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: New Perl programmer looking for answer in Directory Comparisons
by lindex (Friar) on May 01, 2001 at 21:26 UTC |