in reply to checking external program for availability?
if ( -x '/path/to/file' ) { # file is executable, run it system('/path/to/file'); } else { # whatever system('/run/something/else'); } [download]