in reply to A few Perl OOP questions.
That sets $class to the string returned from ref. If that return is false ($type is not a reference), $class is set to the value of $type. That code is used to intuit a class name from an instance of the class, so a class method many be called as if it were an instance method. That is an idiom which is disparaged these days as too admissive of bugs.
$self->{ hireDay }->setDate( @_ );
$self is a reference to a hash. Its 'hireDay' key contains an object with an instance method called setDate. That method is called with the current argument array.
my $self = $class->SUPER::new(); $self is make to be an instance of the first parent class having a new() class method. It$self will likely soon be re-blessed into $class, perhaps with some additional initialization.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: A few Perl OOP questions.
by dragonchild (Archbishop) on Oct 20, 2003 at 13:17 UTC | |
by Zaxo (Archbishop) on Oct 20, 2003 at 22:40 UTC | |
|
Re^2: A few Perl OOP questions. (disparaging)
by tye (Sage) on Oct 22, 2003 at 20:50 UTC | |
by Zaxo (Archbishop) on Oct 23, 2003 at 01:15 UTC | |
by tye (Sage) on Oct 23, 2003 at 07:31 UTC | |
by Zaxo (Archbishop) on Oct 24, 2003 at 06:30 UTC | |
by rir (Vicar) on Oct 24, 2003 at 18:17 UTC |