- or download this
sub new {
my ($class, @args) = @_;
...
# then initialize the parts of the object that are unique to this
+class
return bless($this, $class); # rebless to our class
}
- or download this
sub new {
my ($class, %args) = @_;
...
$$this{foo} = $args{foo};
return bless($this, $class); # rebless to our class
}
- or download this
package SomeSuperclass;
sub new {
...
$this->_init(@_);
return $this;
}
- or download this
package SomeSubclass;
use base SomeSuperclass;
...
$this->SUPER::_init($bar, $baz);
$$this{foo} = $foo;
}