[Catalyst-dev] Annoying undef warnings from CP::Static::Simple

Matt S Trout dbix-class at trout.me.uk
Sun Jun 1 08:01:06 BST 2008


On Sat, May 31, 2008 at 09:30:14AM -0500, Dave Rolsky wrote:
> On Sat, 31 May 2008, Matt S Trout wrote:
> 
> >On Fri, May 30, 2008 at 06:35:11PM -0500, Dave Rolsky wrote:
> >>I'm getting a bunch of warnings from requests for static content that look
> >>like this:
> >>
> >> Use of uninitialized value in length at
> >> /usr/local/share/perl/5.8.8/Catalyst/Dispatcher.pm line 287.
> >>
> >>The problem is that Catalyst::Dispatcher expects $c->req->match to be
> >>defined, but it isn't when CPSS does the dispatching.
> >>
> >>I'm not sure where this should be fixed. Should $c->req->match always be
> >>set? Or should CD just not assume it is defined?
> >
> >There's no $c->action at all when CPSS fires so I don't think I can really
> >see $c->req->match as making a lot of sense in that case.
> >
> >This has already been reported via rt.cpan but sans test; if you can whip 
> >one
> >up there's no reason we can't add a defined() check.
> 
> I've attached a new test and a patch to make it pass.
> 
> As an aside, I realized that part of the reason this was never fixed is 
> that the core Catalyst code does not enable "use warnings" in the modules. 
> However, if you run under the -w flag like the standalone server does, 
> then you get all the warnings from everywhere.
> 
> I think it'd be a good idea to turn on warnings in the core modules and 
> then shut them up. Are such patches welcome?

Yes, against the moose branch off 5.80 - 'use Moose' already turns warnings
on so it's half-way there already and the timeframe for that branch gives us
a reasonable chance of not inflicting a bunch of warnings on users that are
realistically our fault.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst-dev mailing list