in reply to Re^2: kind of effort required for learning OO perl ?!
in thread kind of effort required for learning OO perl ?!
?sub new { my ($class) = @_; return(bless(dog->new(),$class)); }
I borrowed this syntax from the perlbot example:
When I checked that $self reference was indeed blessed before it was passed through bless again:sub new { my $type = shift; my $self = Bar->new; $self->{'biz'} = 11; bless $self, $type; }
What is the harm?DB<3> p UNIVERSAL::isa($self,'Bar'); 1
Celebrate Intellectual Diversity
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: kind of effort required for learning OO perl ?!
by chromatic (Archbishop) on Jul 29, 2010 at 23:08 UTC |