in reply to Apache::Registry and main package
Avoid accessing variables in other packages from within a module like the plague. Pass the variable that you want to use in the subroutine as an argument to the subroutine. Or if you want to get fancy, instantiate an object. Here's the simple way:
AlCommon::ApplicationAbout( %ApplicationDetails ); # ... package AlCommon; sub ApplicationAbout { my %details = @_; foreach my $AboutItem (qw(Name Version Comments)) { print "$AboutItem = $details{$AboutItem}\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Apache::Registry and main package
by allyc (Scribe) on Oct 31, 2004 at 00:09 UTC |