Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: 'state' variables and unit testing (Devel::Init)

by tye (Sage)
on Feb 01, 2014 at 22:36 UTC ( [id://1073004]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package MyConfig;
    ...
    ...
        our %HostConfig;
        return $HostConfig{$key} //= _getConfigForHost( $Host, $key );
    }
    
  2. or download this
    sub getConfig {
        my( $key, $host ) = @_;
    ...
        our %HostConfig;
        return $HostConfig{$key,$host} //= _getConfigForHost( $host, $key 
    +);
    }
    
  3. or download this
    $MyConfig::Host = $test_host;
    
  4. or download this
    for my $host ( ... ) {
        $MyConfig::Host = $host;
        %MyConfig::HostConfig = ();
        ...
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found