Sometimes you have to execute a binary to see if it exists. eg, if you're checking to see if you have GNU cp, you can't just see if there's a file called cp, you need to examine the binary. The easiest way of examining the binary is to execute it.
See, eg, App::Rsnapshot::CheckGNUcp
(please don't use App::Rsnapshot, it's an experimental and as-yet-incomplete rewrite of rsnapshot)
| [reply] [Watch: Dir/Any] |
maybe safer to try binary --help
| [reply] [Watch: Dir/Any] [d/l] |
Yes, but even so, you still have to run the thing. In the case of that particular module, the feature of GNU cp I care about is the -l flag, so that's what I test. If you look in the tests for the module, you'll see that they use --help, so that I'm comparing data from two sources.
| [reply] [Watch: Dir/Any] |