in reply to refrencing a hash
In any event, your second package is getting a copy of package::config's %ERRMSG because the implicit import does something akin to this:
%package::caller::ERRMSG = %package::config::ERRMSG;
If you want a reference to the original hash (no copy) then you can set it up as a reference in your config module.
package Config; use base 'Exporter'; our $ERRMSG = { 123 => 'Some string error1', 456 => 'Some string error2' }; our @EXPORT_OK = qw($ERRMSG); our %EXPORT_TAGS = ( sms => [qw($ERRMSG)] ); package Foo; use Config qw(:sms); print $ERRMSG->{123}; print $ERRMSG->{456};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: refrencing a hash
by give_me_donations (Initiate) on Feb 17, 2005 at 01:21 UTC | |
by give_me_donations (Initiate) on Feb 17, 2005 at 01:36 UTC | |
by friedo (Prior) on Feb 17, 2005 at 01:57 UTC |