Apocrypha

Module-Want

Check @INC once for modules that you want but may not have

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. On and on it goes :) This module 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.

Available in

OverlayNewestEbuildsLast activity
ledgersmb GitHub ↗ 0.600.0 1 2 yr details ›

Versions & arches

VersionOverlay amd64 Committed
0.600.0 ledgersmb amd64 testing view · download · history ↗