Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 meditating upon the Monastery: (7)
As of 2014-12-22 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (110 votes), past polls