in reply to When to use prototype inheritence?

Class::Prototyped strikes me as a good way to do something like Java's nested classes (external link). I don't think I'd want it for a top-level class.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated

Replies are listed 'Best First'.
Re: Re: When to use prototype inheritence?
by bsb (Priest) on Sep 12, 2003 at 08:14 UTC
    I think you're right.

    The good fit would be because the class is small and belongs only in the context of it's definition. That is, within the main class.

    What's more, the returned class can be more dynamic than the Java version. Response to different interfaces, different methods, etc.

    There's an alternative version of Inner Classes at http://perldesignpatterns.com/