However, use base is a mechanism for class-based subclassing. After reading merlyn's article, I knew that this was the proper way to do subclassing with protoypes:package My::HelloWorld; use base CGI::Prototype; sub template { \ <<'END_OF_TEMPLATE' } [% self.CGI.header; %] Hello world at [% USE Date; Date.format(date.now) | html %]! END_OF_TEMPLATE My::HelloWorld->activate;
Since the Class::Protoyped docs do not use base anywhere and since neither your article or docs explain how this class-based inheritance mechanism works in a prototyped context please do one of two things: (1) use a more orthodox means of subclassing (2) explain the ramifications behind such use.package doesnt_matter; use CGI::Prototype; my $derived = Class::Prototyped->newPackage('My::App', ( 'parent*' => 'CGI::Prototype', template => sub { 'blah blah blah' }; ); $derived->activate;
To your credit, a file in the test suite does use @ISA, but I am a bit tired of trying to learn CGI::Prototype by inference on the test suite :)
In reply to CGI::Prototype and use base by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |