5 Oct
2010
5 Oct
'10
12:53 p.m.
On Tue, Oct 5, 2010 at 7:46 AM, Alexis Sukrieh <sukria@sukria.net> wrote:
Le 05/10/2010 14:32, P Kishor a écrit :
and, I get the following runtime error
Can't call method "SUPER::opts" on an undefined value at /Users/punkish/Sites/app/lib/app/app1.pm line 16.
The way you call the opts method matters:
get '/' => sub { "forum opts : ".to_yaml(FooApp::Forum->opts()); };
If you don't call it that way (Class->method) $self is undef, hence your error.
Fantastic! all is well now. This is really great, and might be worth adding to the cookbook. For example, this will also allow me to declare other singletons such as $dbh, for a db handle, in one place and the reuse it in other packages. Many thanks.
-- Alexis Sukrieh
-- Puneet Kishor