Question
When the plugins are loaded the Plugin.pm does not find the handler functions unless they are listed initally in the file.
For instance for the
CalendarPlugin the initPlugin is found, but the commonTagsHandler function is not found, unless it is listed at the top. My perl does not compile with the commonTagsHandler listed at the top because it is referring to a later function in the same file.
Plugins.pm line 154:
if( &$sub( $topic, $web, $user, $installWeb ) ) {
foreach $h ( @registrableHandlers ) {
$sub = $p.'::'.$h;
®isterHandler( $h, $sub ) if defined( &$sub );
}
$activePluginWebs[@activePluginWebs] = $installWeb;
$activePluginTopics[@activePluginTopics] = $plugin;
}
I debugged this and can see that the handler function is not found unless it is at the beginning of the file. Does that make sense at all?
Another weird issue is that the commonTagsHandler of the
CalendarPlugin gives me an
Undefined subroutine &TWiki::Plugins::CalendarPlugin::handleCalendar if I move it to the top.
This is probably some general perl issue I do not understand, any ideas and suggestions greatly appreciated!!
Thanks
- TWiki version: 01-Dec-2001
- Perl version: 5.005_03 built for sun4-solaris
- Web server & version: apache
- Server OS: SunOS 5.8
- Web browser & version:
- Client OS:
--
OleCMeldahl - 03 Apr 2003
Answer
I am not sure, but it could depend on your version of Perl ...
--
AndreaSterbini - 21 Sep 2003