in reply to How to see what is available in Module::Namespace::*
updated: fixed globfor (@INC) { my $path = "$_/MyModule/Plugins"; for my $m (<$path/*.pm>) { $m =~ s{^\Q$_\E/}{}; # strip off everything leading up to MyModul +e... $m =~ s{/}{::}g; # replace / with :: $m =~ s{\.pm$}{}; # remove extension eval "use $m;"; # use MyModule::Plugin::Whatever die if $@; # propagate exceptions } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to see what is available in Module::Namespace::*
by ikegami (Patriarch) on Sep 21, 2009 at 19:45 UTC |