Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: require() @INC hooks problem

by LanX (Saint)
on Dec 27, 2020 at 20:56 UTC ( [id://11125827]=note: print w/replies, xml ) Need Help??


in reply to require() @INC hooks problem

Second guess, careful with private subs

my sub for_inc { my ($coderef, $filename) = @_; return \$source }; my $for_inc_ref = \&for_inc;

instead please try

my $for_inc_ref = sub { my ($coderef, $filename) = @_; return \$source };

unfortunately I can't test right now.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: require() @INC hooks problem
by kcott (Archbishop) on Dec 27, 2020 at 21:12 UTC

    Thanks for guessing; if nothing else, it eliminates possibilities.

    In earlier versions of the code, I did have what you suggest, as well as push @INC, sub { ... };. I tried both of those with and without the my ($coderef, $filename) = @_;.

    — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11125827]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-25 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found