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

Re^4: Inherit parent, AND also import parent's exported sub ??

by exilepanda (Pilgrim)
on Sep 09, 2016 at 11:23 UTC ( #1171454=note: print w/replies, xml ) Need Help??


in reply to Re^3: Inherit parent, AND also import parent's exported sub ??
in thread Inherit parent, AND also import parent's exported sub ??

Seem to work but when I subclass Two, that function just gone again... Seem I should end this in my first subclass by:
sub nameOfOldFunc { shift; return OldClass::nameOfOldFunc ( @_ ) ; }
making it a method, and this become a method ever after.

Thank you very much for the help!

Replies are listed 'Best First'.
Re^5: Inherit parent, AND also import parent's exported sub ??
by stevieb (Canon) on Sep 10, 2016 at 00:52 UTC

    Any chance you could share some of your real code that demonstrates what you're attempting to do? What you've suggested here is not scalable, and a bit confusing.

    Perhaps if we understood the real problem you're facing with real example code, we could provide better solutions to your dilemma.

    Having both inherited and imported subs coming from the same module is a bit unusual, unless you're intentionally directing your API to both OO and functional crowds, or providing backwards-compatibility (there are other scenarios, but I digress).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2020-02-28 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (123 votes). Check out past polls.

    Notices?