Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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

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 musing on the Monastery: (12)
As of 2016-10-21 16:33 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (289 votes). Check out past polls.