Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re^3: Inheritance automation help

by tangent (Curate)
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 browsing the Monastery: (11)
As of 2015-10-07 09:24 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (175 votes), past polls