Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2016-08-28 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (392 votes). Check out past polls.