I expected that the call to new would wind-up executing the code in Foo which would, by means of $class->SUPER::, invoke the one in Bar...But it does. What makes you think it doesn't? I cannot deduce the problem from your code snippet.
use 5.010; package Bar; sub new { say "Bar!"; []; } package Foo; use base qw/Bar/; sub new { my $class = shift; say "Foo!"; my $self = $class->SUPER::new(@_); bless $self, $class; return $self; } package main; my $bletch = Foo->new; say ref($bletch); __END__ Foo! Bar! Foo
In reply to Re^2: Duh. What am I missing about inherited constructors?
by JavaFan
in thread Duh. What am I missing about inherited constructors?
by locked_user sundialsvc4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |