[Belfast-pm] Copying a directory

Andrew McFarland aamcfarland at gmail.com
Tue Oct 24 07:53:39 PDT 2006


How do I copy a directory in Perl?

I've tried

 #!/usr/bin/perl
 use warnings;
 use strict;
 use File::Copy;
 copy("dir1","dir2") || die "Copy failed: $!";

Which gives:

Copy failed: no such file or directory at copy.pl line 5.

(Please be gentle, I'm returning to perl programming after a long absence....)

Andrew
-- 
We can't change the past, but each of us, by challenging prejudice and
intolerance, can help to change the future.
- Rabbi Jonathan Sacks, Address at Holocaust Memorial Day, Westminster
Hall, London, 27th January 2005


More information about the Belfast-pm mailing list