• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item7578: Use of uninitialized value $_[0] in Configure::UI line 138

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Configure Urgent Closed   patch 6.0.2

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


A guy reached out from the #twiki channel, having problems configuring his freshly downloaded copy of TWiki-6.0.1.

When setting a password for the first time, he got a Perl error identical to this one: http://twiki.org/cgi-bin/view/Support/SID-01978:

Use of uninitialized value $_[0] in join or string at /var/www/twiki/lib/TWiki/Configure/UI.pm line 138. 

I noticed that he used Perl 5.20, the same as the guy in the support ticket.

To resolve the issue, I applied a quickfix in his code, only joining those elements in @_ that are defined:

- CGI::td({class=>'secondCol'}, join(' ', @_)))."\n";
+ CGI::td({class=>'secondCol'}, join(' ', grep{defined;} @_)))."\n";

My guess is that Perl 5.20 has implemented some security constraints that breaks compability.

Does anyone see any problem with implementing this in TWiki?

-- TWiki:Main/TerjeAndersen - 2014-10-14

Thank you Terje! See more debug info at TWiki:Support.SID-01981 - it's the TMPDIR that is undefined. So that issue needs to be addressed as well.

-- TWiki:Main.PeterThoeny - 2014-10-14

I recommend to add this (untested) fix:

--- TWiki/Configure/Checkers/Environment.pm   (revision 28198)
+++ TWiki/Configure/Checkers/Environment.pm   (working copy)
@@ -29,7 +29,7 @@
     my $this = shift;
     my $block = '';
     for my $key ( sort keys %ENV ) {
-        $block .= $this->setting($key, $ENV{$key});
+        $block .= $this->setting( $key, defined $ENV{$key} ? $ENV{$key} : '(undefined)' );
     $block = $this->foldableBlock(CGI::em( 'Environment variables' ),
         '(read only) ', $block);

Could anyone verify if this fixes the issue on Perl 5.20? You should get (undefined) for undefined environment variables listed in the "Environment Variable" section of configure.

-- TWiki:Main.PeterThoeny - 2014-10-14

In addition, apply Terje's fix too, but possibly return a more verbose message:

CGI::td({class=>'secondCol'}, join(' ', map{ defined $_ ? $_ : '(undefined)'; } @_)))."\n";

-- TWiki:Main.PeterThoeny - 2014-10-14

It worked in my 5.12.2 perl with CGI module downgraded to 4.04.

-- TWiki:Main.DaniMolina - 2014-10-27

This is now fixed with new pre-installed CgiContrib, tracked in Item7620: Add CGI to TWiki core distribution

-- TWiki:Main.PeterThoeny - 2015-11-29

Summary Use of uninitialized value $_[0] in Configure::UI line 138
ReportedBy TWiki:Main.TerjeAndersen
Codebase 6.0.1, 6.0.0
SVN Range TWiki-6.0.1-trunk, Mon, 29 Sep 2014, build 28107
AppliesTo Engine
Component Configure
Priority Urgent
CurrentState Closed


TargetRelease patch
ReleasedIn 6.0.2
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r6 - 2016-01-22 - PeterThoeny
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback