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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Win32 - MySQL Command

Status
Not open for further replies.

jpillonel

Programmer
Dec 17, 2003
61
CH
Hello,

I have a perl script that check some data in a mysql database.

After that I run the mysql dump like that:

exec( "$dumper -v -$dbexp > $dumpfile" ) or die "Backup Failed ... exiting";

How can I check the return code of this command ? Something like in unix scripts ?

Thnaks for your help ?
 
You won't get a return code from exec, use system() or open() if you need a return code.

system() works backwards to most functions, you have to say:

system($cmd) and die "Call to $cmd failed\n";

You use "and" rather than the more normal "or" or ||

Mike

I am not inscrutable. [orientalbow]

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top