Just want to check and make sure this snippet of code will do what I think it will.

Trying to copy all files from $reportsdir to $oldreportsdir

my $reportsdir = '/usr2/reports';
my $oldreportsdir = '/usr2/oldreports';

# Move everything from the report directory to the old report directory
opendir(DIR, $reportsdir) or die "can't opendir $reportsdir: $!";
while (defined($file = readdir(DIR))) {
        move("$reportsdir/$file", "$oldreportsdir/$file")
        or die "move failed: $!";
}

Tony

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to