Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Duh. What am I missing about inherited constructors?

by JavaFan (Canon)
on Nov 04, 2010 at 18:30 UTC ( [id://869538]=note: print w/replies, xml ) Need Help??


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

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://869538]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-18 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found