On Fri, Apr 27, 2007 at 05:06:40PM +0100, RA Jones wrote:
> Dave Rolsky wrote:
> >Where in the tutorial does it suggest you load non-Catalyst modules 
> >like this?
> >
> >
> Sorry, it wasn't the tutorial, but the catalyst POD under the 
> Description section:
> 
> If your plugin starts with a name other than Catalyst::Plugin::, you can 
> fully qualify the name by using a unary plus:
> 
>   use Catalyst qw/
>       My::Module
>       +Fully::Qualified::Plugin::Name
>   /;
Perhaps it would be good to reword this paragraph of the docs to avoid
similar confusion in future. Although it was clear to me that it only
suggested loading Catalyst plugins, and not other Perl modules, this
way, I can see the ambiguity now it has been pointed out. I suggest the
following:

If you want to load a Catalyst plugin that doesn't live in the
Catalyst::Plugin:: namespace, you can fully qualify the name by
prepending a plus sign. For example, this:

  use Catalyst qw/
      My::Module
      +Fully::Qualified::Plugin::Name
  /;

will load and initialise Catalyst with the plugins
Catalyst::Plugin::My::Module and Fully::Qualified::Plugin::Name.

If you want to load a Perl module that isn't a Catalyst plugin, just
C<use> or C<require> it in each of your modules that needs it, in the
traditional way.

-- 
"And I see losing love is like a  window in your heart:  everybody sees 
 you're  blown  apart;  everybody  sees  the  wind  blow  in Graceland."
 -- Paul Simon, 1986
http://surreal.istic.org/                         How's it going to end?

Attachment: signature.asc
Description: Digital signature

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to