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

Re: Simulating the absence of a module

by gellyfish (Monsignor)
on Jul 04, 2005 at 12:55 UTC ( [id://472218]=note: print w/replies, xml ) Need Help??


in reply to Simulating the absence of a module

It's evil and bad and I'm sure there are many reasons why you don't want to do this, but you can use a CODEREF in @INC to do something like:

BEGIN { @main::OINC = @INC; unshift @INC, sub { if ( $_[1] eq 'CGI.pm') { @INC = ($_[0]); } else { @INC = ($_[0], @main::OINC); } + return undef; + }; } + use strict; use CGI;

/J\

Replies are listed 'Best First'.
Re^2: Simulating the absence of a module
by Thilosophy (Curate) on Jul 04, 2005 at 13:11 UTC
    That's clever. Thanks++;

Log In?
Username:
Password:

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

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

    No recent polls found