in reply to How to check for existence,executabilituy and return code when executing a shell script from perl

It seems like the more appropriate way of performing your task would be to first test if the file exists, perhaps using the -X functions. They can also check file permissions. Lastly, why in the world are you taking a reference to your return after being forced into numeric context and then testing the value? For what you want to test, you should be calling your backticks as $proc =`/aa/bb/cc.ksh arg1`;.

Update: And, to boot, if you want to check your return value for non-decimal characters, your test should be $proc =~ /\D/ - your regex syntax does not do what you think. Please read perlretut.

Update 2:You should also get in the habit of using or in place of || - otherwise you may get Burned by precedence rules (operator precedence).

  • Comment on Re: How to check for existence,executabilituy and return code when executing a shell script from perl
  • Select or Download Code