Tags:
create new tag
, view all tags

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

Topic revision: r5 - 2004-01-02 - PeterThoeny
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.