Smith, Derek wrote:
Why doesn't a copy work on each array element yet a glob does?

I'm assuming you eman copy() from File::Copy?

because copy()'s source doesn't do that I imagine. Is there documentation for copy() that seems to indicate it does?

Is there a way to tell Perl to copy each element of the array off to
another file location?

Yes, write code that does it like you are doing below.

for (my $suffix=0; $suffix <= $#NBlogs2; $suffix++) {

              foreach my $logs (@NBlogs2) {

                  copy ("$logs", "$oldir/$logs.$suffix") or die "Copy
failed $!";

              }

          }


Be consistent and use Best practives:

for my $n(0..$#NBlogs2) {
    for my $log(@NBlogs2) {
copy $log, "$olddir/$log.$n" or warn "Copying $log to $olddir/$log.$n failed: $!";
    }
}


Output of @NBlogs is:

"output" in what way?

Are you getting a die triggeredd? Whats the errror?

Use thye code above and you;ll get more specific, usefull warning about copy failing.

Sorry your questions don't make sense and I know you know better than to assume people can read your mind :)

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to