Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Recursive copier

by DrZaius (Monk)
on Jun 18, 2001 at 22:29 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-23 23:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found