On Tue, 2002-05-07 at 11:37, siren jones wrote:
> I'd like to test the following command to see if it
> ran successfully?  Have no idea how or which variable stores
> the success of a command ($!, $], $_ )?
> 
> system "tar cvf ../test.tar *.grib";
> 
> 
> Tried:
> 
> if (system "tar cvf ../test.tar *.grib";) { print "\nSuccess!\n";}
> 
> got:
>    "Command not found"
> 
> 
> Thank you in advance.
> 
> -s

<snip href="perldoc -f system">
        @args = ("command", "arg1", "arg2");
        system(@args) == 0 or die "system @args failed: $?"

You can check all the failure possibilities by
inspecting "$?" like this:

        $exit_value  = $? >> 8;
        $signal_num  = $? & 127;
        $dumped_core = $? & 128;

When the arguments get executed via the system
shell, results and return codes will be subject to
its quirks and capabilities.
</snip>

-- 
Today is Boomtime the 54th day of Discord in the YOLD 3168
Frink!

Missile Address: 33:48:3.521N  84:23:34.786W


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to