[Catalyst] How to pass vars to modules

RA Jones ra.jones at dpw.clara.co.uk
Fri Apr 27 17:06:40 GMT 2007


Dave Rolsky wrote:
> On Thu, 26 Apr 2007, RA Jones wrote:
>
>> Just for information, why do you say that? The tutorial suggests 
>> doing just that.
>
> Doing that to load non-Catalyst plugins buys you nothing, and obscures 
> how modules are loaded. For example, when I want to find all the 
> modules I'm using, I usually do something like this:
>
>   grep -r '^use '
>
> Then I might run that through sort and uniq to trim the list.
>
> Why add yet another way to load modules? It's not like passing module 
> names to catalyst like that will do something different.
>
> 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
   /;

But it's OK as I'm persuaded by the previous arguments that it is better 
to load non-plugin modules in the controllers as needed. 
DBIx::Class::QueryLog was probably a better example to cite which I 
previously loaded as +DBIx::Class::QueryLog.
--
Richard Jones
Leeds, UK

**********************************************************************
This message  may  contain  confidential  and  privileged information.
If you are not  the intended  recipient please  accept our  apologies.
Please do not disclose, copy or distribute  information in this e-mail
or take any  action in reliance on its  contents: to do so is strictly
prohibited and may be unlawful. Please inform us that this message has
gone  astray  before  deleting it.  Thank  you for  your co-operation.

NHSmail is used daily by over 100,000 staff in the NHS. Over a million
messages  are sent every day by the system.  To find  out why more and
more NHS personnel are  switching to  this NHS  Connecting  for Health
system please visit www.connectingforhealth.nhs.uk/nhsmail
**********************************************************************




More information about the Catalyst mailing list