Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^3: Inheritance automation help

by tangent (Priest)
on Apr 05, 2012 at 09:10 UTC ( #963618=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Inheritance automation help
in thread Inheritance automation help

have the result say "this is shared" for each Extra Test
I'm not quite sure what you require but, adding to Grandfather's first code example, this may help:
package Top; # ... sub shared { my ($self) = @_; my $type = ref $self; print "Test ($type): This is shared\n\n"; } # ... package main; # ... print "Extra test:\n"; $test->shared(); print "Extra one:\n"; $one->shared(); print "Extra two:\n"; $two->shared();
This will print:
Extra test: Test (Top): This is shared Extra one: Test (Top::Extend1): This is shared Extra two: Test (Top::Extend2): This is shared

Comment on Re^3: Inheritance automation help
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2015-11-26 17:54 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (705 votes), past polls