eXile has asked for the wisdom of the Perl Monks concerning the following question:
My code: module Blah:use Blah ( Config => '/home/me/config.txt' );
If I add 'use Blah (Config => "/configfile")' to my code it doesn't seem to pass the config to 'Othermodule'. Where am I going wrong?package Blah; use AppConfig; my $config = AppConfig->new(); sub import { my (%args) = @_; if ( $args{'Config'} ) { $config->file($args{'Config'}); } #### next few lines for testing only use Data::Dumper; print Dumper(\%args); } use Othermodule ( Config => $config );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use Module (LIST) and 'import'
by duff (Parson) on Nov 30, 2004 at 21:08 UTC | |
by eXile (Priest) on Nov 30, 2004 at 22:04 UTC | |
by Stevie-O (Friar) on Dec 01, 2004 at 00:32 UTC | |
|
Re: use Module (LIST) and 'import'
by ysth (Canon) on Dec 01, 2004 at 05:45 UTC | |
|
Re: use Module (LIST) and 'import'
by rrwo (Friar) on Dec 02, 2004 at 01:00 UTC |