in reply to Working with TAR files

Oh yes: tar will return binary 0 on successfull termination.

Replies are listed 'Best First'.
Re: Re: Working with TAR files
by SpaceCake (Initiate) on May 24, 2004 at 13:51 UTC
    to my $testing is going to be 0 and not undef ?

      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