FAQ

On Jul 16, 2007, at 8:48 AM, Daniel McBrearty wrote:

is there a way to have some C's and M's load into catalyst
conditionally? for example, if some config variable is set?
You can call load_classes() and pass something other than the default
values. At one point for some reason I wanted to load only the
modules at the top of my Schema directory, and not include anything
in subfolders, so I did this:

throws ::Error::Unexpected;

# Only get the first level items, I don't want sub folders.
use Module::Find;
__PACKAGE__->load_classes(map { substr $_, length(__PACKAGE__ .
'::') } findsubmod(__PACKAGE__));

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 8 | next ›
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJul 16, '07 at 1:48p
activeJul 18, '07 at 2:51a
posts8
users6
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase