Devel::Examine::Subs::Preprocessor - Provides core pre_proc callbacks for Devel::Examine::Subs
use Devel::Examine::Subs::Preprocessor; my $compiler = Devel::Examine::Subs::Preprocessor->new; my $pre_proc = 'module'; if (! $compiler->exists($pre_proc)){ confess "pre_proc $pre_proc is not implemented.\n"; } my $compiled_ok = eval { $pre_proc_cref = $compiler->{pre_procs}{$pre_proc}->(); 1; };
Pre-processors run prior to the main processing routine that does the file reading and subroutine compilations.
Use a pre-processor to manipulate the system early in the call chain, or get and return data that doesn't require reading any files.
Use Devel::Examine::Subs pre_proc_return parameter to return the data after the pre-processor has run to avoid unnecessary work by the processor.
Devel::Examine::Subs
pre_proc_return
All methods other than exists() takes an href of configuration data as its first parameter.
exists()
exists('pre_proc')
Verifies whether the engine name specified as the string parameter exists and is valid.
module
Mandatory parameters: { module => 'Module::Name' }
{ module => 'Module::Name' }
This pre-processor returns an array reference of all subroutines within the namespace of the module listed in the module parameter.
The data is returned early as mentioned in the "DESCRIPTION".
inject
Parameters: { inject_use => ['use statement1;', 'use statement2;'] } or { inject_after_sub_def => ['code line 1;', 'code line 2;'] } or { line_num => $num, code = \@code }>
{ inject_use => ['use statement1;', 'use statement2;'] }
{ inject_after_sub_def => ['code line 1;', 'code line 2;'] }
{ line_num => $num, code =
Injects each element of the array ref as either a use statement, lines of code after a sub definition, or a block of code immediately after the line number.
remove
Parameters: delete => 'string'
delete => 'string'
Deletes the entire line of code, if it contains 'string'.
Steve Bertrand, <steveb at cpan.org>
<steveb at cpan.org>
You can find documentation for this module with the perldoc command.
perldoc Devel::Examine::Subs
Copyright 2016-2020 Steve Bertrand.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Devel::Examine::Subs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Examine::Subs
CPAN shell
perl -MCPAN -e shell install Devel::Examine::Subs
For more information on module installation, please visit the detailed CPAN module installation guide.