BioHazard has asked for the wisdom of the Perl Monks concerning the following question:
Thank you very much for your suggestions, Monks.package Foo; use strict; my %config = _fill_config(); sub new { my $proto = shift(); my $status = shift() || 'normal'; my $package = ref($package) || $package; my $self = { status => $status }; bless($self, $package); return $self; } sub change_config { my $self = shift(); return unless $self->{status} ne 'admin'; %config = _fill_config(); } sub _fill_config { my %temp = _parse_file('config.cfg'); return %temp; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing package variable via object-instance
by liz (Monsignor) on Aug 25, 2003 at 17:48 UTC | |
|
Re: Changing package variable via object-instance
by bobn (Chaplain) on Aug 25, 2003 at 18:14 UTC | |
|
Re: Changing package variable via object-instance
by herveus (Prior) on Aug 25, 2003 at 17:45 UTC | |
|
Re: Changing package variable via object-instance
by BioHazard (Pilgrim) on Aug 25, 2003 at 19:20 UTC | |
by bbfu (Curate) on Aug 25, 2003 at 20:58 UTC |