in reply to Re^5: require() @INC hooks problem
in thread require() @INC hooks problem
use strict; use warnings; use Data::Dump qw/pp dd/; sub create_class { my ($class) = @_; my $source = <<"__CODE__"; package $class; sub import { warn "$class imported"; } __CODE__ eval $source; my $name = $class =~ s(::)(\/)gr; $INC{"$name.pm"} = 'imported via eval'; } BEGIN { create_class('Jabba::Dabba'); } pp \%INC; use Jabba::Dabba;
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: require() @INC hooks problem
by LanX (Saint) on Dec 28, 2020 at 17:04 UTC |