However, Perl is not psychic. So, when you see most constructors ending with: bless $self, $class; $self is not modified.This is wrong, $self is modified. Try e.g. this:
sub foo { my $self = {}; bless $self, 'Bar'; return $self; } print "isa Bar.\n" if foo()->isa('Bar');
-- Hofmator
In reply to Re: Re: why is a 2-argument bless not working in my situation
by Hofmator
in thread why is a 2-argument bless not working in my situation
by eXile
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |