in reply to Re^3: Recursion up The Inheritance Chain
in thread Recursion up The Inheritance Chain

Thanks for the help, unfortunately quux doesn't recurse. you're not calling Bar->quux which then calls Foo->quux. I'm trying to create a single method that runs once for every package in the inheritance chain.
  • Comment on Re^4: Recursion up The Inheritance Chain

Replies are listed 'Best First'.
Re^5: Recursion up The Inheritance Chain
by zwon (Abbot) on Dec 18, 2009 at 19:37 UTC

    Can you show us your code, so we could get an idea of what are you trying to do? The following works for me:

    use strict; use warnings; use 5.010; package Bar; sub baz { say 'buzzzzz...'; Foo->baz; } package Foo; our @ISA = qw(Bar); package main; Foo->baz; __END__ buzzzzz... buzzzzz... buzzzzz... buzzzzz... ...
Re^5: Recursion up The Inheritance Chain
by keszler (Priest) on Dec 18, 2009 at 20:30 UTC
    If I'm understanding you, you want to define a Foo->Plugh method but not a Bar->Plugh method, create an instance $snafu of a Bar, call $snafu->Plugh, and execute Bar->Plugh then Foo->Plugh. Is that correct?