use backticks or qx() instead of system or exec. As perldoc -f system and same for exec will tell you, that's going to give you the result of the shell level command call, while system gives you the result of the call to system which is not what you want.
Update: system, as borisz told us, is the call you're looking for, but be careful because end-of-Update:
My GNU tar actually gives back the names of the extracted files on STDOUT, even when it is called with system, but that's not the behaviour I had expected. Maybe have a few test runs to see what your tar does.
Update2: Yes, testing for undef works allright.
Cheers, Sören
|