in reply to cd in perl not working?

Perl waits for each command to finish -- i believe that involves spawning a new process and waiting on it, collecting the results. Which, by the way, you should be reporting on. Can you provide the error message? This will help us to understand what the real problem is.

Also, if this is all that this script does (and you are in a Unix like environment) then you should use a shell to execute this stuff, like bash:

cd /path/to/dirs tar -czvf dir1.tgz dir1/ ... mv /path/to/dirs/dir1.tgz /backup/dir1.tgz ...

Finally, Perl has File::Copy and other modules for archiving files as well as a built in mv named rename -- so if you are going to keep this in Perl you might want to use those and eliminate some overhead that system brings.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)