in reply to Load all modules in directory
As others have, suggested, require is the answer. However, in order to get the full functionality of use, you should call import on the package you just required.
Also, I'm not sure if this is intentional, but globbing those files leaves the .pm on, which may not be what you want. Try addingBEGIN { @mods = glob("/home/cuberat/mods/*"); for (@mods) { require $_; $_->import; } }
to your for loop before the require.s{.pm}{};
Are you sure it was a book? Are you sure it wasn't.....nothing?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Load all modules in directory
by mcogan1966 (Monk) on Dec 10, 2003 at 20:24 UTC | |
Re: Re: Load all modules in directory
by ttcuberat (Sexton) on Dec 10, 2003 at 20:33 UTC | |
by ysth (Canon) on Dec 11, 2003 at 05:13 UTC |
In Section
Seekers of Perl Wisdom