Help for this page

Select Code to Download


  1. or download this
    BEGIN {
      eval "require CGI::Simple; CGI::Simple->import;"
    ...
         $main::q = CGI::Simple->new;
      }
    }
    
  2. or download this
      use Module::prefer 'prefer';
      # use CGI::Simple if possible, CGI otherwise
    ...
          'CGI'         => [1],
        ],
      );
    
  3. or download this
      $chosen = prefer( \@modspec, @default_args );
    
  4. or download this
      [ 'Module::Name' => [ $use_default_args, @special_args ], ... ]
    
  5. or download this
      # 'bar' in default, special args for Module::A
      $chosen = prefer (
    ...
        'bar',
      );
    
  6. or download this
      # 'foo' and 'bar' in default, Module::B does it's own thing
      $chosen = prefer (
    ...
        'foo', 'bar',
      );
    
  7. or download this
    package Module::Prefer;
    use strict;
    ...
      );
    
    =cut