Help for this page

Select Code to Download


  1. or download this
    if ( $] >= 5.006 ) {
       print "This is good, your Perl is version $]\n";
    ...
    else {
       warn "Your Perl is only version $]: Bad!";
    }
    
  2. or download this
    require 5.006_001;  # check at run-time, at this point in code.
    use 5.006_001;      # check at compile-time
    
  3. or download this
    eval {
       require 5.006_001;
    ...
       warn "Your Perl is too old."
       system ('n:\\install\\upgrade-perl.exe'); # imaginary
    }
    
  4. 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
    }
    
  5. or download this
    if (-f 'c:\\program files\\some app\\app.exe') {
       print "APP is installed, good.\n";
    ...
    else {
       warn "APP not installed!";
    }