use strict; use warnings; use File::Copy::Recursive qw(dircopy); my $fromdir = '/tmp/myfiles'; my $todir = '/home/peter'; dircopy($fromdir,$todir) or die $!;