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

Re: Can I from within a module access variables from the calling program? (modular design)

by tye (Sage)
on Oct 25, 2012 at 14:47 UTC ( [id://1000879]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Your::Module( $log_file );
    
  2. or download this
    use Your::Module;
    Your::Module->set_log_file( $log_file );
    
  3. or download this
    package Your::Module;
    # ...
    ...
        my( $we, $log_file ) = @_;
        Log::Log4perl->init( \"... $log_file ..." );
    }
    
  4. or download this
    package main;
    use strict;
    ...
    
    our $log_file = ...;
    Log::Log4perl->init( ... );
    
  5. or download this
    package Your::Module;
    
    Log::Log4perl->init( \qq< ... $main::log_file ... > );
    
  6. or download this
    package main;
    use strict;
    ...
    Log::Log4perl->init( ... );
    
    use Your::Module; # Must happen after $log_file is set. DON'T MOVE UP!
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-24 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found