How can I get the exit status?

L

laredotornado

Hello,
I have a perl script that launches a Unix process that calls another
Perl script:

`perl /myscripts/gen_ecom_xml.pl $ckit_file > $xml_file`;


and I am wondering how I can get the exit status value and any
potential error messages?

Thanks in advance, - Dave
 
B

Brian McCauley

Hello,
I have a perl script that launches a Unix process that calls another
Perl script:

`perl /myscripts/gen_ecom_xml.pl $ckit_file > $xml_file`;


and I am wondering how I can get the exit status value and any
potential error messages?

Rather than passively "wondering" could I suggest you should have taken
a look section of the reference manual that describes the behaviour of
the backquotes.

Anyhow, look at the documentation of the $? special variable and the FAQ
"How can I capture STDERR from an external command?".
 
B

Brian McCauley

Anyhow, look at the documentation of the $? special variable and the FAQ
"How can I capture STDERR from an external command?".

I forgot to mention the FAQ "What's wrong with using backticks in a void
context?".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,918
Members
47,458
Latest member
Chris#

Latest Threads

Top