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
In reply to Re: A few Perl OOP questions.
by Zaxo
in thread A few Perl OOP questions.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |