In TWiki's scripts,
CGI::Carp
is required
before we have a chance to add TWiki's own lib directories which provide it. This breaks in Perl versions where
CGI
is no longer part of the Perl core because of incompatible changes in current CPAN versions. See
TWiki:Codev.TWikiWithCurrentPerl
for details.
- Done in Rev. 30317 (not shown here??) and Rev. 30319. No problems so far, should be good to go. -- TWiki:Main/HaraldJoerg
- 2017-05-26
--
TWiki:Main/HaraldJoerg
- 2017-04-07
--
TWiki:Main.HaraldJoerg
- 2017-07-06
Second try.... all files in the
bin
directory are patched as shown in the attachment
nocgi.diff
. Now, the procedure is like this:
- Immediately at start, activate
Carp::confess
as a die
handler. Carp.pm is in Perl core since at least version 5.8.8. This works for CLI and CGI environment, regardless of whether CGI.pm
comes with Perl, or is installed on the system, or neither of both.
- Set
$TWiki::cfg{Engine}
according to the environment, but do not switch to CGI::Carp
for a CGI environment right now.
- Add the current directory to
@INC
and require 'setlib.cfg'
.
- Since we've already activated a
die
handler, problems in setlib.cfg
or LocalLib.cfg
will provide a stacktrace as confess
does (unless suppressed by eval
).
- Now, after
setlib.cfg
is done, it is safe to switch to CGI::Carp
only in a CGI environment and establish CGI::Carp::confess
as die
handler. At this stage the fallback provided by TWiki's own copy of CGI::Carp
is available!
The last step could also be factored out into the equivalent
BEGIN
block in
TWiki.pm
.
--
TWiki:Main.HaraldJoerg
- 2017-11-02
This seems to be fixed now, marking it ready for release. If needed, open a new item.
--
TWiki:Main.PeterThoeny
- 2018-07-15