in reply to globalization sorrows
and Mold->init():sub spawn { my $this=shift or die; my $class=ref($this) || $this; my $self = { }; bless $self,$class; $self->{parent}=$self || die; $self->{mold}=$self || die; $self->init; return($self); }
now... see why i didn't want that thrown in? ;)sub init { my $self=shift; $SIG{__DIE__} = sub {endwin; }; $SIG{__WARN__} = sub { endwin; warn @_; my $i = 0; while (my($pkg, $file, $line) = caller($i++)) { warn " package $pkg, file $file, line $line\n"; } }; $self->{prefs} = Prefs->spawn($self); $self->{prefs}->load_rc(); $self->{prefs}->load_terrains($self->{prefs}->{datadir} . "/terrain +s"); $self->{uic} = UI_Curses->spawn($self); $self->{com_int} = Command_Interpreter->spawn($self); $self->{grid} = Grid->spawn($self); $self->{com_proc} = Command_Processor->spawn($self); $self->{player} = Player->spawn($self); $self->{eq} = EventQueue->spawn($self); $self->{data_monsters} = Data::Monsters->spawn($self); $self->{msg} = Message->spawn($self); $self->{eq}->addclass('thingy'); }
every one of those spawn commands use Standard.pm to inherit the spawn command.
And my goal is to stop passing along $self.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: globalization sorrows
by demerphq (Chancellor) on Jul 06, 2003 at 19:02 UTC |