in reply to Re: How do I make a constructor?
in thread How do I make a constructor?
sub new { return (bless {}, shift)->init(@_); } sub init { my $self = shift; $self->SUPER::init(@_); 1 # put stuff to initialize here or die "Failed to init $self: blah blah\n"; return $self; }
Makeshifts last the longest.
|
|---|