in reply to Object Oriented Programming in Perl.
just in addition to the others' constructors:
sub new { my $class = shift; $class = ref $class || $class; # other stuff bless $self,$class; }
It allows you to use the constructor as an instance method. This is also described in perltoot and imho very usefull.
--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Object Oriented Programming in Perl.
by aufrank (Pilgrim) on Aug 05, 2002 at 19:04 UTC |