MG-RAST/AWE

using exit status with perl

teharrison opened this issue · 0 comments

This is a helpful tip when using perl to create apps for AWE client. If your perl script is calling a child script using system() and tries to return the child scripts exit status if it fails, make sure you 8 bit shift the return value of system() to get the real exist code. If this is not done you may inadvertently return a value that is a modulus of 256 (ie. 512), causing the AWE client to think it was successful.

http://stackoverflow.com/questions/7080434/getting-perl-to-return-the-correct-exit-code
http://perldoc.perl.org/functions/system.html