I have written a Perl script, I just want to give it to every one,
for that I planned to write a bash script which is used to test the environment of a user and find whether that environment is capable of running the Perl script.
I want to test the things like:
- Whether Perl has installed in that system
- Perl should have the version 5 or more
- Whether the module JSON::Any is available
Any suggestion would greatly appreciated 🙂
I often use ‘
${PERL:-perl}‘ and similar constructs to identify the command (forawkvsnawkorgawk;troffvsgroff; etc).If you want to test the version of JSON::Any, capture the output from the command instead.
If you want to test the version of Perl, add ‘
use 5.008009;‘ or whatever number you think is sensible. (It wasn’t so long ago that they finally removed Perl 4 from one of the NFS-mounted file systems at work – but that was not the only Perl on the machine – at least, not in the last decade or more!)