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

Correct syntax for using $INC to keep modules in same file

by perl-diddler (Hermit)
on Jun 25, 2012 at 01:00 UTC ( #978097=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package FOO::BAR;
    BEGIN {::$INC{FOO/BAR.pm}=1};
    
  2. or download this
    {package mem; 
    [#1] BEGIN{$::INC{'mem.pm'}=1}  #1: '#' present if in separate file
    1}
    
  3. or download this
    { package Dbg; 
      use mem &{sub(){$::INC{'Dbg.pm'}=1}};
    ...
      our $FRE;
      use mem &{sub(){$FRE = qr{:([^:]+)$} } };
      use mem &{sub(){our @EXPORT = qw(Tracing Dumping Trackback DDump TPe
    +) } };
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2015-07-02 06:38 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 (30 votes), past polls