- or download this
if ( $] >= 5.006 ) {
print "This is good, your Perl is version $]\n";
...
else {
warn "Your Perl is only version $]: Bad!";
}
- or download this
require 5.006_001; # check at run-time, at this point in code.
use 5.006_001; # check at compile-time
- or download this
eval {
require 5.006_001;
...
warn "Your Perl is too old."
system ('n:\\install\\upgrade-perl.exe'); # imaginary
}
- or download this
# import a version of a module at compile time, die on failure
use Module 1.02; # dies unless Module is at least v1.02
...
warn "Module is not available";
# maybe install it here
}
- or download this
if (-f 'c:\\program files\\some app\\app.exe') {
print "APP is installed, good.\n";
...
else {
warn "APP not installed!";
}