Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^3: Inheritance automation help

by tangent (Deacon)
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?
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 pondering the Monastery: (11)
As of 2014-09-18 16:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (117 votes), past polls