in reply to Re^2: Compare and copy array values
in thread Compare and copy array values

No, you don't.

But loop variables should be declared in the loop construct:

foreach my $item (@list) { }
or (means the same)
for my $item (@list) { }

Replies are listed 'Best First'.
Re^4: Compare and copy array values
by tgolf4fun (Novice) on Mar 19, 2008 at 23:24 UTC
    I printed some of the output because it was not working correctly and it tries to put the hash key value pair in as the directory to copy to and I just want the keys as the directory names to copy to in:

    copy($file, "$to_dir/$dir") or warn "Cannot copy '$file' to '$to_dir/$fi le' $!"