create new tag
, view all tags


I installed Twiki on z/OS 1.6. This is an ebcdic platform that uses codepage IBM-1047. I converted all textfiles to this codepage. When changing values on the configure page and pressing 'Next' I get the following error:

"Software error: HPE20221 Unmatched ( in regex; marked by <-- HERE in m/^(\.htaccessO.\\.(?i)( <-- HERE ?:php­0-9s]?(\..\)?O­sp]htm­l]?(\..\)?OplOpyOcgi))$/ at /opt/data/twiki/lib/TWiki/Configure/Types/REGEX.pm line 37, line 1. "

I am new to TWiki and Perl, so any help/suggestion is welcome.


TWiki version: TWikiRelease04x01x02
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: z/OS 1.6
Web server: IBM Http Server
Perl version: v5.8.7 built for os390-thread-multi
Client OS: MS Windows XP sp2
Web Browser: IE 6.0
Categories: Installation

-- TWikiGuest - 23 Oct 2007


ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.

Sorry, closing this after more than 30 days of inactivity. Please feel free to re-open if needed.

-- PeterThoeny - 03 Dec 2007

I have reproduced this error on a fresh TWiki 4.2.0 installation. The error_log in Apache says: Unmatched [ in regex; marked by <-- HERE in m/^[ <-- HERE ^\s\*?~^\$@%`/ at /var/www/html/twiki420/lib/TWiki/Configure/Types/REGEX.pm line 38, line 1.

Perl version 5.8.0, Apache version 1.3.27, OS is Red Hat Linux 9 heavily patched.

-- CarlPatten - 13 Feb 2008

Same Problem here on z/OS 1.8.

-- KevinKeller - 27 Feb 2008

What Permissions are set on configure? 755?

-- JosephTrexler - 29 Feb 2008

555 on configure

One other note: it allows me to save one change fine. The error occurs if I make a second change and try to save it. For instance, I open the Miscellaneous category, change {Stats}{TopViews} from 10 to 12, click "Next," enter my password, click "Save". That works. Then I click the "Return to Configuration" link, go back and change TopViews to 9. I click "Next" and get the error in my web log. I have to completely exit my browser to be able to save configuration changes again. Reproduced under both Firefox and Internet Explorer 6 web browsers.

-- CarlPatten - 17 Mar 2008

From emails that I have read (in passing) on the perl 5 porters mailing list, it seems that no-one has reported to them the staus of ebcdic support. They don't have any information to suggest that it works (or to suggest that it does not).

While this problem sounds (from Carl's report) to not be ebcdic specific - it sounds like they (the perl project) could do with your help.

unfortuanaly, I havn't managed to reproduce the problem :/

-- SvenDowideit - 18 Mar 2008

There are two entirely different OSs and character sets being used here (potentially):

  • Carl - Since you are running TWikiOnLinux on your mainframe, this is not an EBCDIC issue at all - Linux on IBM mainframes runs in ASCII.
  • Kevin and original poster (TWikiGuest) - your issue may well be due to Perl EBCDIC support - have a look in the TWiki code for the 'is it EBCDIC' test and run this from the command line to check if EBCDIC is working at all.

All - please state whether you are using Linux on top of z/OS when you get this error - and preferably create a new Support request for each case, as it's somewhat confusing - Kevin in particular hasn't given any details.

To check which character code you are using, run this one-liner from the Unix/Linux shell:

      perl -e 'print (("A" eq chr(193) ? "ebcdic" : "ascii")."\n") '
Although it's odd that two sets of people are getting similar issues, there are different character sets, OSs and Perl versions in at least two of the cases, and the detailed error messages are different even though they have similarities - so it would be best to split Carl's Linux issue into a separate Support request.

All (but particularly z/OS users):

  • Which browser character set is your web server configured for? Typically you would convert IBM-1047 on the web server (i.e. used by TWiki) to and from ISO-8859-1 or some other ASCII-based character set (i.e. used to and from the web browser). However, that's probably not the issue here as this is a server side error.
  • Try installing an older version of TWiki that was known to work on mainframes, which would help determine if the issue is in Perl/OS, character set, or TWiki. The comments on RewritingUrlsWithEscapedCharsUnderOs390 may help - the patches I made there for I18N with EBCDIC were included in TWikiRelease04Sep2004, which is quite an old version but should help narrow this down.

-- RichardDonkin - 19 Mar 2008

Having just looked at the code for 4.2.0, lib/TWiki/Configure/Types/REGEX.pm has some suspicious code that would probably break EBCDIC usage - this code is basically validating a regular expression that is entered into configure. See line 30 in particular, which hard-codes ASCII values:

 $value =~ s/([[\x01-\x09\x0b\x0c\x0e-\x1f"%&'*<=>@[_\|])/'&#'.ord($1).';'/ge;

To fix or work around this:

  • Directly edit the LocalSite.cfg file generated by configure - something of a hack as you'll need to do this again every time you save from configure
  • Modify REGEX.pm to use EBCDIC values instead of the hard coded ASCII ones - you should be able to find a suitable conversion table somewhere.
  • (Harder) Modify this code to not use 0x... constants at all - if it's possible to avoid these the code should automatically work on EBCDIC

Of course, it might be to do with how your web server translates (or not) the input of forms - so some TWikiDebugging will be required here with 4.2.0.

Since there was a lot of code changed in TWiki 4.0 and later, there may be other ASCII-isms, so you might find these issues in other places too. However, a quick grep -R '\b0x[0-9a-f][0-9a-f]' . doesn't reveal anything important (the Attach.pm hits are where it looks at image file headers which will remain in ASCII I think).

-- RichardDonkin - 19 Mar 2008

Closing question, seems to be answered.

Best to open a bug report if there is one. Link provided in sidebar.

-- PeterThoeny - 01 May 2008

Hi there, I am installing Twiki 4.2.3 on IBM Mainframe running z/OS 1.9 (EBCDIC), and I am experiencing the same problem as that described in this log.

I was a bit disappointed to see that there did not seem to be a fix 'in the pipeline' - is that the case?

I work for a large supermarket chain inthe UK, and we are running: Z/OS 2.9 IBM HTTP Server V5.3 This is perl, v5.8.7 built for os390-thread-multi The output of the perl diagnostic command is: JXSH:/u/jsdbsp/jbsp02 $r(193) ? "ebcdic" : "ascii")."\n") ' <


I am not an expert on perl, so I am seeking advice on how to make this legendary line 30 of the REGEX.pm work, so that I can demonstrate Twiki on mainframe.

Please advise.

-- BruceWoodley - 24 Oct 2008

Bruce, from what I can see, the lack of pipeline for EBCDIC support is due to a lack both in platform, and developers. This situation appears to be true in the Perl project as much as in TWiki.

What seems to be missing is a level of self interest based active involvement - people and companies with EBCDIC system support desires testing, reporting and fixing issues.

Even if I were to find time to work on it, I don't have a platform to work on, or the domain expertise - its been 8 years since I touched a 2200 or A Series.

What we'll need to resolve this, is permanent (and presumably root) access to a system, and someone that either knowns about perl&ebcdic, or is able to find time to get that knowledge. And then lastly a set of automated tests to highlight issues to the majority of developers who will never know enough about non-ascii. (this is true of non-simple ascii localisation support too).

As Richard points out, line 30 isn't likely to be the only problem - just the first.

-- SvenDowideit - 26 Oct 2008

Hi Sven, Thanks for your review of this issue and your prompt response.

I think what your are saying is that: I should try and determine the resolution myself and report this resolution back to yourselves, so that you can integrate it into your Twiki source code.

For my part I will atempt to find a perl programming expert who can decipher the code fragment in question. For your part, I wonder if you could put me in contact with a Company/Twiki user that is using Twiki on the Mainframe? Maybe a joint effort will enable us to find a resolution to what appears to be an EBCDIC-specific problem introduced in this release!

Many regards Bruce Woodley mobile number can be supplied if you or another Twiki mainframe user wants to txt me. my work email is: bruce.woodley@sainsburysPLEASENOSPAM.co.uk

-- BruceWoodley - 29 Oct 2008

Change status to:
Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r12 - 2008-10-29 - BruceWoodley
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.