День добрый!Каким образом можно получить код возврата при выполнении внешнего приложения? Т.е. я вызываю программу из скрипта на perl, но мне нужен не вывод это программы (@result=`date`), а именно тот код возврата который устанавливает внешенее приложени при выходе. Т.е. то же самое, что в shell дает $?.
Смотрим "perldoc perlfunc", функция system():> Because `system' and backticks block `SIGINT' and
> `SIGQUIT', killing the program they're running
> doesn't actually interrupt your program.
>
> @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. See the section on
> "`STRING`" in the perlop manpage and the exec
> entry elsewhere in this document for details.
>Смотрим "perldoc perlfunc", функция system():
>
>> Because `system' and backticks block `SIGINT' and
>> `SIGQUIT', killing the program they're running
>> doesn't actually interrupt your program.
>>
>> @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. See the section on
>> "`STRING`" in the perlop manpage and the exec
>> entry elsewhere in this document for details.
Тьфу ты, тоже только увидел :(