[Catalyst] OT Config::General question

Kieren Diment diment at gmail.com
Fri Nov 7 00:00:51 GMT 2008


On Thu, Nov 06, 2008 at 06:13:20PM -0500, Jesse Sheidlower wrote:
> 
> I want to set up my new PageCache configuration in a
> Config::General style. I need to change this:
> 
> __PACKAGE__->config(
>       'Plugin::PageCache' => {
>           expires => 300,
>           set_http_headers => 1,
>           auto_cache => [ '^(search)' ]
>           debug => 1,
> 
>         }
> );
> 
> into this:
> 
> <Plugin::PageCache>
> 	expires 3600
> 	set_http_headers 1
> 	auto_cache [ '^(search)' ] # uh...
        auto_cache ''
> 	debug 1
> </Plugin::PageCache>
>

Add an extra line above auto_cache with something that will evaluate
as undef.  That ought to do it.

> The problem is, auto_cache needs to be an arrayref even though
> there's only a single item in it, and I don't know how to
> force Config::General to interpret it this way; if it's in the
> docs, I'm missing it. Right now I get an error like
> 
>   Caught exception in engine "Can't use string ("[ '^(search)' ]")
>   as an ARRAY ref while "strict refs" in use
> 
> I get the same error if I try to remove the brackets.
> 
> If I add another line like "auto_cache *", then things just
> work, because with two identically named lines it assumes an
> array, but I assume there has to be a way to make C::G read
> this as an arrayref?
> 
> Thanks.
> 
> Jesse
> 
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/



More information about the Catalyst mailing list