in reply to Re^2: converting to a sub-class
in thread converting to a sub-class

It's perfectly sane, don't be shocked :-)

The technique you're using is related to the Factory Pattern. It's quite an established idea.

Note that the hint to avoid hard-coding (parts of) the class name is good.

Replies are listed 'Best First'.
Re^4: converting to a sub-class
by Cagao (Monk) on Oct 20, 2007 at 17:47 UTC
    Ahh yes, the Factory pattern, I'd heard of that, isn't there 2 main ways of doing this sort of thing? Factory being one, what's the other?

    So that use of ->require, etc. looks fine then?

    I'll use __PACKAGE__ in future of course.

    if Person::Male shouldn't be a class, how else would it be done?