in reply to RE: Factory Pattern for Class Heirarchy
in thread Factory Pattern for Class Heirarchy

You're gonna hate me for saying this, but check out autouse. {grin}

-- Randal L. Schwartz, Perl hacker

  • Comment on RE: RE: Factory Pattern for Class Heirarchy

Replies are listed 'Best First'.
RE: RE: RE: Factory Pattern for Class Heirarchy
by johannz (Hermit) on Oct 10, 2000 at 07:57 UTC

    Merlyn, I don't hate you :-)

    Actually, I have seen 'autouse' before and had just forgot about it. And it's even in the standard distro. The biggest difference between the 'autouse' module and my code is that my module doesn't require any pre-declaration of what modules you want to use; you just call them and they get loaded. It's a step beyond run-time loading. Not that I'm promoting this as how this should be done; this was just an educational exercise.

    In developing this module, I had the chance to look at AUTOLOAD and the 'goto' function and gain a better understanding of what they were capable of. As I said in the notes with my code, this was not something I would put into production code. But it was a demonstration of one way to approach this problem.