in reply to return status from system()
Use system ("...") and ......
If 'system' fails to execute, the commands after the 'and' would operate. So you could probably assign an appropriate value to a variable (say $ret="false") after the 'and' clause.