Question
After installing the
CalendarPlugin, I receive the following error --
Software error:
Undefined subroutine &TWiki::Plugins::CalendarPlugin::handleCalendar called at ../lib/TWiki/Plugins/CalendarPlugin.pm line 113.
For help, please send mail to the webmaster ({email_address}), giving this error message and the time and date of the error.
Perl Modules Installed Correctly --- but not visible via Apache CGI ?
The perl modules
Bit::Vector,
Date::Calc, and
HTML::CalendarMonthSimple each seem to be installed correctly because:
- the
examples that shipped with each of these modules will run correctly from the unix command line.
- installation was also verified according to the instructions provided by cpan.
Yet for some reason, the same perl modules do not work correctly with the apache CGI because:
- they do not appear in the list provided by
testenv (see attached).
- they do not function properly for the CalendarPlugin (see error message above)
Please assist, thank you
Environment
| TWiki version: |
01 Feb 2003 |
| TWiki plugins: |
CalendarPlugin |
| Server OS: |
Unix (aix 4.3.3) |
| Web server: |
IBM_HTTP_Server/1.3.12.4 Apache/1.3.12 (Unix) PHP/4.2.3 |
| Perl version: |
5.00503 |
| Client OS: |
Windows 2000 Professional |
| Web Browser: |
Microsoft IE 6.0.2800.1106 |
--
KeithHelfrich - 29 Oct 2003
I've had the same problem and gave up. Could it be a perl version issue(I'm on same version on Solaris)? I juggled the ordering of the functions and I got the same error but on different functions.
--
OleCMeldahl - 31 Oct 2003
Answer
The
../lib/TWiki/Plugins/CalendarPlugin.pm path indicates that you are using relative path for the TWiki libs. There is a known issue in case a script changes the default script path to something else. Set an absolute path in
twiki/bin/setlib.cfg. This should fix your first problem.
The second problem could be caused by not listing the root dir of
Bit::Vector,
Date::Calc and
HTML::CalendarMonthSimple in the Perl lib path (
@INC
). Test what
@INC
is on your shell and on testenv. It could also be file-permission problem, that is, the new dirs and libs need to be readable by the
nobody user.
--
PeterThoeny - 31 Oct 2003
Still Problems
Peter, thanks.
Unfortunately the problem still exists. As suggested: an absolute path is now set in
twiki/bin/setlib.cfg. Same error still occurs at
CalendarPlugin --- except now the error message gives a full path. Please see also the new output from
testenv (attached).
Software error:
Undefined subroutine &TWiki::Plugins::CalendarPlugin::handleCalendar called at /usr/local/docroot/twiki/lib/TWiki/Plugins/CalendarPlugin.pm line 113.
The root dir for
Bit::Vector,
Date::Calc and
HTML::CalendarMonthSimple seems correctly set in the Perl lib path (
@INC
). These modules were each installed into
/usr/opt/perl5/lib/site_perl/5.005/aix. The
@INC
from a command line shell is the exact same as
@INC
from
testenv. And all of the new directories and libraries are readable by 'world'.
Output from
perl -V (compare
@INC
with new output from
testenv):
Characteristics of this binary (from libperl):
Built under aix
Compiled at Aug 14 1999 08:59:55
@INC:
/usr/opt/perl5/lib/5.00503/aix
/usr/opt/perl5/lib/5.00503
/usr/opt/perl5/lib/site_perl/5.005/aix
/usr/opt/perl5/lib/site_perl/5.005
.
What could the problem be ?
Are you in a hosted environment? If so, it is possible that there are two installs of Perl around sharing your home directory. When you run from the command line you are doing so in a different environment to when the webserver runs.
If this is the case, then they are probably separate machines providing those environments. Solution? Speak to your hosting provider.
YMMV.
--
MartinCleaver - 05 Nov 2003
I am experiencing this same problem after much debugging of problems with
CalendarPlugin. I have reviewed
HelpInstallingCalendarPlugin and
CalendarPlugin. At present, my environment reports it's configuration as follows:
twiki/bin/setlib.cfg now has the variable set to:
$twikiLibPath = '/home/www/sites/twiki.sps.mot.com/lib';
http://twiki.sps.mot.com/bin/testenv reports:
@INC library /proj/sysadm/ess/perl-modules/lib/site_perl/5.8.0/sun4-solaris-64int
path: /proj/sysadm/ess/perl-modules/lib/site_perl/5.8.0
->>>>>> /home/www/sites/twiki.sps.mot.com/lib
/usr/local/lib/perl5/5.6.0/sun4-solaris
/usr/local/lib/perl5/5.6.0
/usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris
/usr/local/lib/perl5/site_perl/5.005
/usr/local/lib/perl5/site_perl
Yet the error message still reports what appears to be a relative path
Software error:
Undefined subroutine &TWiki::Plugins::CalendarPlugin::handleCalendar called at ../lib/TWiki/Plugins/CalendarPlugin.pm line 115.
For help, please send mail to the webmaster (aspweb@asp.sps.mot.com), giving this error message and the time and date of the error.
In addition,
@INC
reports the path to additional PERL modules (the first two path lines as reported by
testenv. What's left? What could be imposing a relative path? I'm looking for some pointers.
Thanks
--
SteveRJones - 12 Nov 2003
Solved the Undefined Subroutine Problem ---> But Still No Calendar
I've gotten around the
undefined subroutine problem, but the
CalendarPlugin is still not working.
PeterThoeny was correct
earlier ---> the root dir of
HTML::CalendarMonthSimple was not found in my Perl lib path (
@INC
).
This is how I solved that problem ...
- updated @INC
by editing $localPerlLibPath in ../twiki/bin/setlib.cfg
- included the location of
CalendarMonthSimple.pm, not previously listed in @INC
- edited
CalendarPlugin.pm, add the following:
-
include "CalendarMonthSimple.pm";
Now I'm over the undefined subroutine hurdle !! Never-the-less, my
CalendarPlugin still does not work. These are my new symptoms:
- Just like the CalendarPlugin topic on
twiki.org, I do not see a calendar displayed under the column if correctly installed:
-
By the way, why does the CalendarPlugin not work correctly on twiki.org ?
-
Does the plugin work correctly at all .. anywhere, for anybody ?
- Also, the CalendarPlugin does not appear in the list of
ACTIVATEDPLUGINS in TWikiPreferences
I have a feeling that as soon as I can figure out how to get it to be recognized as an
ACTIVATEDPLUGIN, then I should be doing OK. Any help would be greatly appreciated !! I really want for this to work.
Thanks very much --
KeithHelfrich -- 08 December, 2003
Funny Observation about ACTIVATEDPLUGINS
Just noticed this peculiarity about my actions above ::
- BEFORE updating
CalendarPlugin.pm to add include "CalendarMonthSimple.pm";
- AFTER updating
CalendarPlugin.pm to add include "CalendarMonthSimple.pm";

So editing
CalendarPlugin.pm to solve the
CalendarPluginUndefinedSubroutine, somehow removes
CalendarPlugin from the list of
%ACTIVATEDPLUGINS%
We're getting the Undefined Subroutine error also, after our TWiki installation was moved to a disk with a newer version of Solaris. Following Martin's suggestion above, I discovered that there are two Perl installations on the box, and of course, the web server is picking up the old one. I think we're on the road to getting this fixed. The Calendar used to work fine, and it is a much-beloved feature. (And one that people depend on, hence my gratitude.)
Thanks Martin (and Keith for starting this topic).
--
JamesCollins - 12 Feb 2004
After months of
calendar envy, I've finally convinced the
CalendarPlugin to work on my home wiki with perl 5.8. {Feelings of elation}. Now, if we could only get the thing to work at the office, where the calendar is more important --- updating to perl 5.8 is the answer.
--
KeithHelfrich - 07 Jun 2004
I ran into the Undefined Subroutine problem also (Perl 5.8). For diagnosis use
%FAILEDPLUGINS% in place of
%ACTIVATEDPLUGINS%. I found that HTML::CalendarSimple was loading ok but it was in turn failing to find Date::Calc. These modules are both installed in a local lib directory, the base of which is already set up as $twikiLibPath, but Date::Calc installs into $lib/i386-linux-thread-multi rather than plain $lib. By setting this to $localPerlLibPath in setlib.cfg, the plugin now works (and appears in ACTIVATEDPLUGINS). Obviously the exact value to use depends on your OS/architecture.
--
BenWheeler - 14 Dec 2005
Use with Perl 5.6 or earlier
I'm still researching this, but check out the following output with perl5 (5.0 patchlevel 5 subversion 3)
$ perl -c CalendarPlugin.pm
Operator or semicolon missing before %months at CalendarPlugin.pm line 336.
Ambiguous use of % resolved as operator % at CalendarPlugin.pm line 336.
Illegal modulus zero at CalendarPlugin.pm line 336.
And here's the output with perl5 (revision 5.0 version 8 subversion 0)
$ perl -c CalendarPlugin.pm
CalendarPlugin.pm syntax OK
It would appear that the
CalendarPlugin.pm REQUIRES perl 5.8. Line 336 references perl's
our construct, which is not available in perl 5.005_03. The "Perl Version: 5.000 and up" on the plugin page would appear to be incorrect.
--
AndyBakun - 04 Mar 2004
*
PeterThoeny: "TWiki.CalendarPlugin, should work with older Perl if you replace all occurances of
our with
my in =CalendarPlugin.pm=" (from
AccessControlAndPermissionIssues)
--
TWikiGuest - 20 Oct 2004
Further to this last point: has anybody got
CalendarPlugin running with Perl 5.6? It used to work, but when we upgraded to the latest TWiki, we upgraded the plugins & now it simply produces no output (not even a display of the %Calendar% variable. Running
perl -c CalendarPlugin.pm
gives syntax ok (I changed all "our" to "my").
--
ChrisHogan - 12 Nov 2004
Answered my own question, yes if you follow the instructions & change
our to
my then it works - my ongoing problem was with the ISP "accidently" removing
HTML::CalendarMonthSimple - nothing to do with the plugin itself.
--
ChrisHogan - 17 Nov 2004
Answer summary
- Upgrade to perl 5.8, or modify CalendarPlugin.pm as above.
- Don't use relative paths in setlib.cfg
- Try adding the architecture-dependent lib directory to @INC
in setlib.cfg
- Find someone to maintain CalendarPlugin
--
CrawfordCurrie - 16 Jun 2004
-- Updated:
BenWheeler - 14 Dec 2005