[cgiapp] CGI::App - creating your own overloaded functions

Brad Van Sickle bvansickle3 at gmail.com
Tue Aug 25 13:55:43 EDT 2009


That did it.  One of those things that's obvious once it's pointed out.

 Thanks!

Rhesa Rozendaal wrote:
> Brad Van Sickle wrote:
>> I find myself duplicating a lot of postrun code, so I'd like to move 
>> that entire function up to a superclass file to centralize it.
>> My problem with doing that is that at I still have some logical 
>> constructs that I need to set somewhere in each modules that are 
>> module/runmode dependent.
>
> [snip]
>
>> So what I've done is created a module in my superclass:*
>> *sub app_module_define_JS*
>> *    {*
>> *    my $self = shift;*
>> *    return;*
>>    }*
>> I then call that module at the start of post run*
>> my $JSIncludes=&app_module_define_JS;*
>
> That should be:
>
>   my $js = $self->app_module_define_JS;
>
> otherwise it isn't OO. &foo is the sub defined in the current package, 
> so you're disabling method dispatch.
>
> HTH,
> rhesa
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>


More information about the cgiapp mailing list