Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Having Module::Pluggable find plugins at runtime

Report this thread to moderator Post Follow-up to this message
Old Post
Robin
04-19-05 01:55 PM


Re: Having Module::Pluggable find plugins at runtime
On 4/19/05, Robin <robin@kallisti.net.nz> wrote:
> Hi, I'm using Module::Pluggable to give a program plugin support.
> Basically, I'll have a directory full of .pm files and I want them to be
> loaded and instantiated. That's all well and good, however all the
> examples at
> http://search.cpan.org/dist/Module-...le/Pluggable.pm
> seem to presume that you know the path at code-writing time, which isn't
> the case for me. Basically what I have is the path to the plugins being
> passed in when my own PluginMgr class is being instantiated, and then I
> want to give that information to Module::Pluggable and have it load them
> all up for me.
>=20
> How can I do this? Or perhaps do it in a different way by manually runnin=
g
> through the directory and "require'ing" each file. The problem I have
> with that method is that I don't know how to get the class name out so
> that I can then instantiate it.
>=20
> --
> Robin <robin@kallisti.net.nz>             JabberID: <eythian@jabber.org>
>=20

Robin,

What does your current code look like, and what errors is it
returning.  From the docs, it looks at though most of what you need is
evaluated at runtime:  "The method search_path is exported into you
namespace as well. You can call that at any time to change or replace
the search_path."  If you're designing it, you can also make the paths
relative, and tell your users what directory they have to keep modules
in.  Most applications that allow plugins do this.  eval blocks will
also dely things until runtime.  you have lots of options here,
depending on what exactly it is your trying to to.  Post some code,
and people can help you with it.

--jay

Report this thread to moderator Post Follow-up to this message
Old Post
Jay Savage
04-19-05 08:56 PM


Re: Having Module::Pluggable find plugins at runtime

Report this thread to moderator Post Follow-up to this message
Old Post
Robin
04-20-05 08:56 PM


Re: Having Module::Pluggable find plugins at runtime

Report this thread to moderator Post Follow-up to this message
Old Post
Robin
04-20-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:20 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.