Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Cancel/no-op a require

by sedusedan (Monk)
on Dec 07, 2012 at 12:52 UTC ( #1007731=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    unshift @INC, \&import_hook;
    require Foo; # nothing is loaded
    require Bar; # nothing is loaded
    
  2. or download this
    unshift @INC, sub {
        return (undef, sub {0});
    }
    
  3. or download this
    use Tie::Handle::Scalar;
    unshift @INC, sub {
        tie *FH, "Tie::Handle::Scalar", ""; # or "1;\n"
        #$INC{$name} = undef; # or $name. testing
        return (*FH);
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1007731]
Approved by tobyink
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2015-07-28 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls