in reply to Duh. What am I missing about inherited constructors?

I told you my brain was befuzzed.   The :: should have been -> in that posting.

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...

Replies are listed 'Best First'.
Re^2: Duh. What am I missing about inherited constructors?
by JavaFan (Canon) on Nov 04, 2010 at 18:30 UTC
    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