1 Apr
2011
1 Apr
'11
8:21 a.m.
On 28/03/11 22:38, David Precious wrote:
On Mon, 2011-03-28 at 20:51 +0100, Simon Wistow wrote:
I'd really like to be able to do something like this
package MyApp;
use MyApp::Secret;
prefix 'undef';
before sub { # do something };
package MyApp::Secret;
prefix '/secret';
before sub { return unless auth&& auth->is_admin; }
I've tried to do something similar to Simon too and been disappointed. I was trying: load_app 'MyApp::Secret', prefix =>'/secret', before => &admin_only; I think the surprising thing is the fact that "before" spans packages. Within a package, I'm happy with multiple occurrences chaining, but it seems wrong for an included module to change global behaviour. -- Richard Huxton Archonet Ltd