Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System() errors

Status
Not open for further replies.

jjjon

Technical User
Jul 31, 2002
165
IE

Don't know if this is actually possible or not, but I want to run a system command from a perl script using system(), and I want to catch any errors from the system command. I have...

$x = system("c:\syscom.exe");

if the syscom.exe returns an error, i want to be able to go off and do some error handling.

(Note: My Perl is VERY poor!!)
Thanks for any help
 
Sorry, just noticed a previous post about this!!
 
Hye,

to catch the event error, what you can do is:

my $return_code = 0xfff $ system("your command");
if($return_code ne 0){&ErrorMsg;}

Julie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top