in reply to Re: use Module (LIST) and 'import'
in thread use Module (LIST) and 'import'

OK that's clear, thanks! Is there some other way to achieve my goal of being able to specify a config-parameter in a 'use'-statement and be able to pass it to other modules?

Replies are listed 'Best First'.
Re^3: use Module (LIST) and 'import'
by Stevie-O (Friar) on Dec 01, 2004 at 00:32 UTC
    This can be done like so:
    package Blah; use AppConfig; my $config = AppConfig->new(); sub import { my (%args) = @_; if ( $args{'Config'} ) { $config->file($args{'Config'}); } require OtherModule; OtherModule->import(Config => $config); #### next few lines for testing only use Data::Dumper; print Dumper(\%args); }
    --Stevie-O
    $"=$,,$_=q>|\p4<6 8p<M/_|<('=> .q>.<4-KI<l|2$<6%s!<qn#F<>;$, .=pack'N*',"@{[unpack'C*',$_] }"for split/</;$_=$,,y[A-Z a-z] {}cd;print lc