|Syntactic Confectionery Delight|
Need help untangling inheritance and scope in CGI::App module.by hesco (Deacon)
|on May 02, 2006 at 00:13 UTC||Need Help??|
hesco has asked for the wisdom of the Perl Monks concerning the following question:
And another one, if I may . . .
The code below are the relevant excerpts from the module we're building here. But this one is confusing me. This database conection was working for me before I commented it out of cgiapp_init() and tried to offload the work into a new dbh() routine.
The errors read: "Error executing class callback in init stage: Can't call method "config_file" on an undefined value at /home/hesco/anmc/sb/Registration/Registration/lib/Registration/WWW/RegForm.pm line 114." Line 114 is a part of the dbh() routine and reads: $self->config_file('/var/lib/cf/tbd/regform/Registration.ini');
So what here is the undefined value? Isn't $self defined? Why wouldn't it be passed from cgiapp_init? If not $self, then how is it that a hard coded path would be undefined?
I don't get it?