[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#733903: ITP: libmodule-want-perl -- module to check @INC only once for wanted modules

Package: wnpp
Owner: gregor herrmann <gregoa@debian.org>
Severity: wishlist
X-Debbugs-CC: debian-devel@lists.debian.org,debian-perl@lists.debian.org

* Package name    : libmodule-want-perl
  Version         : 0.6
  Upstream Author : Daniel Muey <http://drmuey.com/cpan_contact.pl>
* URL             : https://metacpan.org/release/Module-Want
* License         : Artistic or GPL-1+
  Programming Lang: Perl
  Description     : module to check @INC only once for wanted modules

Sometimes you want to lazy load a module for use in, say, a loop or function.
First you do the eval-require but then realize if the module is not available
it will re-search @INC each time. So then you add a lexical boolean to your
eval and do the same simple logic all over the place.

Module::Want encapsulates that logic so that have_mod() is like eval {
require X; 1 } but if the module can't be loaded it will remember that fact
and not look in @INC again on subsequent calls.

Reply to: