RE: Perl Class simple problem: What is "die" being used for?

2004-05-29 Thread Charles K. Clarkson
Rob Richardson wrote: : Greetings! : : I'm curious about the Graeme's _init() method, reproducted below: : : sub _init { : my $self = shift; : die $self->site(); : } : : What is "die" used for? I thought that the effect of "die" : was to end the process. Tha

Perl Class simple problem: What is "die" being used for?

2004-05-29 Thread Rob Richardson
Greetings! I'm curious about the Graeme's _init() method, reproducted below: sub _init { my $self = shift; die $self->site(); } What is "die" used for? I thought that the effect of "die" was to nd the process. That's not the effect here, though. What is it doing here? Thanks very muc

Re: Perl Class simple problem

2004-05-29 Thread drieux
On May 29, 2004, at 5:10 AM, Graeme McLaren wrote: [..] I create an object and pass a value to my constructor like this: Conf->new(site=>'x'), this tells the constructor which site I want the config for, then at the end of the constructor I call $self->_init(); This passes a reference to $self (

RE: Perl Class simple problem

2004-05-29 Thread Charles K. Clarkson
Graeme McLaren wrote: [snip useful code] : $self->_init(); Pass the site to _init(): $self->_init( $arg{site} ); : } : : sub _init{ : my $self = shift; my $site = shift; die $site; : die %{$self}; : } That was the short answer. The long an

Perl Class simple problem

2004-05-29 Thread Graeme McLaren
Afternoon all, I'm trying to write a class for configuration values for different sites so that they can use the same conf class, then create an object and get whatever value they need. The problem I have this: I create an object and pass a value to my constructor like this: Conf->new(site=>'x'