Module::Loaded(3perl)
π Module::Loaded π
okay bestie, so this is the page for Module::Loaded, straight out of the Perl Programmers Reference Guide β¨
πΈ NAME πΈ
Module::Loaded β the little guy that marks modules as loaded or unloaded π
β¨ SYNOPSIS β¨
use Module::Loaded;
$bool = mark_as_loaded('Foo'); # Foo.pm is now marked as loaded
$loc = is_loaded('Foo'); # location of Foo.pm set to the
# loaders location
eval "require 'Foo'"; # is now a no-op
$bool = mark_as_unloaded('Foo'); # Foo.pm no longer marked as loaded
eval "require 'Foo'"; # Will try to find Foo.pm in @INC
likeβ¦ look at that. the eval "require 'Foo'" is literally a no-op now. the audacity. the power. π
π¦ DESCRIPTION π¦
so when you're testing applications, you'll lowkey find yourself needing to provide functionality in your test environment that would usually be provided by external modules. and instead of munging the %INC by hand to mark those external modules as loaded (so perl doesn't even try to load them), this module is giving very simple. you mark modules as loaded and/or unloaded, and you move on with your day. that's it. that's the whole vibe. π«Ά
π FUNCTIONS π
$bool = mark_as_loaded( PACKAGE );
marks the package as loaded to perl. PACKAGE can be a bareword or a string, whichever you're feeling. β¨
if the module is already loaded, mark_as_loaded will carp about it and tell you from where the PACKAGE has been loaded already. like, it will call you out. π
$bool = mark_as_unloaded( PACKAGE );
marks the package as unloaded to perl β which is the exact opposite of mark_as_loaded, no notes. PACKAGE can be a bareword or string here too. π
if the module is already unloaded, mark_as_unloaded will carp about this and tell you the PACKAGE has been unloaded already. again: called out. π
$loc = is_loaded( PACKAGE );
is_loaded tells you if PACKAGE has been marked as loaded yet. PACKAGE can be a bareword or string, you already know the drill. π
it returns false if PACKAGE has not been loaded yet, and on success it returns the location from where it is said to be loaded. bestie literally doxxing your module's origin, and honestly? we love that for us. π
π BUG REPORTS π
please report bugs or other issues to bug-module-loaded@rt.cpan.org πβ¨ (in the original page it's written as <bug-module-loaded@rt.cpan.org<gt>, so yes, exactly like that.)
π AUTHOR π
this module by Jos Boumans <kane@cpan.org>. icon behavior. π
π COPYRIGHT π
this library is free software; you may redistribute and/or modify it under the same terms as Perl itself. periodt. π
and that's the whole page, bestie π§ β this was perl v5.44.0, dated 2026-10-17, and yeah it's Module::Loaded(3perl). go mark some modules, you absolute legend. πβ¨
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms