> [Dispatch] ERROR' for request '/': Unable to load module
> 'WebApp::Controller::Foo': Bad name after :: at
> WebApp/Controller/Base.pm line 98.
>
> ############ WebApp::Controller::Base ###################
> sub model {
> my $c = shift;
> my $subclass = shift or die 'Required attribute missing';
> ..
> my $obj = WebApp::DB::$subclass->new(); # <= THIS IS LINE 98
You need quotes around the package name. With them 'WebApp::DB::' is
like a constant...and you just can't concatenate variables like this.
This little script demonstates the bug and the fix:
package Foo::Zoo;
sub new { print "you found me!\n"; }
package main;
use strict;
my $a = 'Zoo';
# Uncomment either one for testing.
Foo::$a->new;
# "Foo::$a"->new;
Mark
--
http://mark.stosberg.com/
##### CGI::Application community mailing list ################
## ##
## To unsubscribe, or change your message delivery options, ##
## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp ##
## ##
## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ##
## Wiki: http://cgiapp.erlbaum.net/ ##
## ##
################################################################