Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Recursive copier

by DrZaius (Monk)
on Jun 18, 2001 at 22:29 UTC ( #89393=note: print w/replies, xml ) Need Help??


in reply to Recursive copier

Hehe, after a comment from btrott and a cold shower I realized I answered the wrong question. Oh well :) You probably don't need recursion in your algo if you use a File::Copy/File::Find combo like this:
use strict; use File::Copy qw/copy/; use File::find qw/find/; sub rcopy { my $src = shift; my $dst = shift; find(sub { my ($src_file, $dst_file) = ($File::Find::fullname, $File::Find::fullname); $dst_file =~ s!^$src!$dst!; copy $src_file, $dst_file or die "Could not copy $src_file => $dst_file:$!"; }, $src); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://89393]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2021-12-05 18:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?