in reply to cd in perl not working?

That's not how system() works. Or rather, see system. It spawns a shell, which executes the cd command and then exits, leaving your program's working directory completely unchanged. You want to use Cwd chdir.

Also consider replacing shelling out to mv with rename.

Replacing tar with Archive::Tar is possible, but Archive::Tar is limited by your available memory and likely is less compatible than your installed tar binary.

Update: runrig is correct, chdir is what's needed, not getcwd from Cwd.

Replies are listed 'Best First'.
Re^2: cd in perl not working?
by runrig (Abbot) on Nov 27, 2008 at 00:38 UTC
    you mean chdir. Cwd gives you the Current Working Directory.