Module::Mask

Pretend certain modules are not installed
Download

Module::Mask Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Matthew Lawrence
  • Publisher web site:
  • http://search.cpan.org/~mattlaw/

Module::Mask Tags


Module::Mask Description

Pretend certain modules are not installed Sometimes you need to test what happens when a given module is not installed. Module::Mask is a Perl module that provides a way of temporarily hiding installed modules from perl's require mechanism. The Module::Mask object adds itself to @INC and blocks require calls to restricted modules.Module::Mask will not affect modules already loaded at time of instantiation.SYNOPSIS use Module::Mask; { my $mask = new Module::Mask ('My::Module'); eval { require My::Module }; if ($@) { # ... should be called } else { warn "require succeeded unexpectedly" } } # The mask is out of scope, this should now work. eval { require My::Module }; # There's also an inverted version: { my $mask = new Module::Mask::Inverted qw( Foo Bar ); # Now only Foo and Bar can be loaded by require: eval {require Baz}; } Requirements: · Perl


Module::Mask Related Software