NAME
Devel::Events::Generator::Require - Event generator for loading of code using require.
SYNOPSIS
use Devel::Events::Generator::Require;
my $g = Devel::Events::Generator::Require->new( handler => $h );
$g->enable();
# all calls to require() will generate a try_require and a require_finished event
$g->disable();
# events disabled
DESCRIPTION
This generator allows instrumentation of module/file loading via require. This includes use statements.
EVENTS
- try_require
-
Fired before
requireactually happens.- file
-
The file that
requirewas given.Note that when doing
<require Foo::Bar>, the parameter passed intoCORE::requireis actually<Foo/Bar.pm>, and not the module name.
- require_finished
-
Fired at the end of every require, successful and unsuccessful.
- file
-
The file that
requirewas given. - matched_file
-
The entry of
filein%INC. - error
-
The load error, if any.
- return_value
-
The value returend by the file. This is always a scalar.
METHODS
- enable
-
Make this instance the enabled one (disabling any other instance which is enabled).
This only applies to the
object_blessmethod. - disable
-
Disable this instance. Will stop generating
object_blessevents. =item try_requireGenerates the
try_requireevent. - require_finished
-
Generates the
require_finishedevent.