Gossamer Forum
Home : General : Perl Programming :

Software error ... unmatched [] in regexp

Quote Reply
Software error ... unmatched [] in regexp
Hi,

I use Links SQL v1.13 and its been working fine, but now after installing mod_perl (cpan > install Bundle::Apache), I get the following error when trying to Add records through the admin control:

Code:
Software error:

/([-\w!\#$%&'*+.^_\`|{}~]+):\s+([^]*)/: unmatched [] in regexp at (eval 7) line 100.

For help, please send mail to the webmaster (postmaster@qango.com), giving this error message and the time and date of the error.
Content-type: text/html
I've looked through the related GT scripts and cannot find anything on a 'line 100' that is related to the route used by the Add functions?

I haven't modified any of the GT scripts, and I've done a couple of reboot's since I did the mod_perl install.

Any idea what's happening? I really would like to get it 'back to normal' Smile

Thanks in advance for any assistance.

All the best
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
As a follow-up, the following perl modules were installed when I ran cpan> install Bundle::Apache;

mod_perl 1.25
Apache::DB 0.06
Apache::DBI 0.10
Tie::IxHash 1.21
CGI3 3.02
Devel::Symdump 2.01
libwww-perl 5.53
HTML::Parser 3.25
URI 1.12
Digest::MD5 2.13
MIME::Base64

I've also tested a few other scripts/apps (including my mySQL based ad-management) and they appear to work fine, so it would seem this problem is isolated to GT LinksSQL v1.13, but I'm buggered if I can work out what's going on!!

It also seems an unusual error message in that it doesn't tell you which file the error has come from?

If anyone can help out, I'd really appreciate it as I can't add any new categories.

Thanks.
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Hi,

Have a look at your .def files. Do you have custom regex's set in there?

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Hi Alex,

I've had a look and there's nothing out of the ordinary that I can see, and I certainly haven't changed/resync'd the defs recently.

I'm also a bit vexed by the fact that its not reporting a file name where the error is occuring, I'm so used to seeing; error in file at line where so and so has happened ...

I have noticed that installing Bundle::Apache has updated Perl to 5.6.0, would that make a difference?

Thanks.
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Hi,

If you don't run in under mod_perl do you see the error? I had a look, and can't find that regex anywhere in Links SQL 1.x.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Alex,

So far I haven't been able to get mod_perl working, and you're right the expression isn't anywhere in LSQL that's why I thought it may have something to do with Perl 5.6.0?

mod_perl's throwing up errors and someone's trying to get that part working for me, but this error started straight away after the Bundle::Apache install, before I'd done anything, and so far it's happened every time without mod_perl ever being installed.

Here's the modules that were installed (from my webmin perl module records):

mod_perl 1.25
libwww-perl 5.53
Apache::DB 0.06
Apache::DBI 0.10
Tie::IxHash 1.21
CGI3 3.02
Devel::Symdump 2.01
HTML::Parser 3.25
URI 1.12
Digest::MD5 2.13
MIME::Base64 2.12

So far it only appears to affect my Links SQL installation (my other apps. seem to work fine), and only when adding/modifying records.

I also checked for calls to outside modules but couldn't find any that were related to the 'add' routine, so its got me really flumoxed Smile

I'm pretty sure it has something to do with the bundle installation, and suspect Perl 5.6.0, but I can't figure out how to uninstall this version and reactivate my 5.003.00 original installation.

Any ideas?

All the best
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Hi,

You could try changing the path to perl to:

#!/usr/local/bin/perl5.00503

or something similiar. There should be a perl5.00503 somewhere.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Alex,

Thanks but that didn't work since @INC was missing some references. I've done some looking around and thinking and come to the following conclusion (hmmmm ... although I may be barking up the wrong tree altogether Smile):

admin.cgi's only reference to 'outer' modules is use CGI ();

So I downloaded all the perl 5.6.0 files and looked in CGI and its subs. I 'knocked out' all files with less than 100 lines and it leaves the following:

Cookie.pm -- $path = CGI::url(-absolute=>1) unless defined $path;
Object.pm -- *layer = \&CGI::Object::Html::layer;
Html.pm -- while (@_) {
Multipart.pm -- unless ($filename) {
Response.pm -- ['','','',''],@_);

Here's the error again, in full:


/([-\w!\#$%&'*+.^_\`|{}~]+):\s+([^]*)/: unmatched [] in regexp at (eval 7) line 100.


Now, if I'm reading this correctly its complaining of a failure in the 7th inst. of an evaluation string in some file at line 100, right?

Actually, I'm going to give this a rest .... I've been going round in circles for the past 16 hours with no luck, I'll come back to it later ... Thanks for all the help so far ... hopefully I can get this sorted and get back to normal soon Smile

All the best
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Hi,

Try adding at the beginning of your CGI script:

use Carp;
$SIG{__DIE__} = \&Carp::cluck;

and then in your error logs, you should see a much better error with stack trace that should help you track this down.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Alex,

Thanks for the tip, its given a whole host of new and useful info about the error. Unfortunately, I still can't manage to find the specific point of the error, although it does appear to originate from Multipart.pm in Perl 5.6.0, or is at least related.

Since the error_log was so long, and included references to other modules, I've saved the log and mod's as text files here:

error_log - http://www.qango.com/gos-threads/error.txt
Multipart.pm - http://www.qango.com/...ads/multipart-pm.txt
State.pm - http://www.qango.com/...threads/state-pm.txt
Object.pm - http://www.qango.com/...hreads/object-pm.txt
CGI.pm - http://www.qango.com/gos-threads/cgi-pm.txt

I wondered if you could possibly pin-point the error for me, or if you're busy, maybe someone else could help me to sort this out. If it was simple to do, I would be happy to revert back to my older version of perl, but there doesn't seem to be an easy way to uninstall 5.6.0, and I'm still a Linux newbie Smile

I'm going to see if this is an issue with 5.6.0 and try to find some Perl references that may be of use, but if someone can come up with a solution in the meantime I'd sure appreciate it ...

All the best
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
After noting the 'multipart' section of the error I looked at the source of the 'Add' form and it had the following in the 'form' line:

ENCTYPE="multipart/form-data"

... if I remove this from the form line in Admin_HTML.pm the form works fine .... so would it be okay to remove it, would it damage or screw anything up, or is this the easiest way to cure the problem?

Thanks, and sorry to be a pain with all these posts ....

All the best
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
It looks like CGI.pm is broken. Right now things work, but you will not be able to upload files using CGI.pm. Any file upload form will cause that error.

I would try upgrading CGI.pm:

perl -MCPAN -e 'install CGI'

and see what happens.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Alex,

Thanks ... I tried that and was told I had the latest version installed. However, when I looked at the README for this dist. (CGI.pm-3.02.readme) is says it's in ALPHA state at present and is not stable, which explains some things Smile

There are older versions of CGI.pm at CPAN that I could install and I wondered which version you'd recommend, what are you using at present?

All the best
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Hi,

Use the latest 2.x series:

http://www.perl.com/.../CGI.pm-2.753.tar.gz

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Thanks Alex,

I'll give that a go and see if it cures the problems Smile

.... fingers crossed ....

All the best
Shaun

Quote Reply
Re: Software error ... unmatched [] in regexp In reply to
Yippee!!!!!

It would appear that it's cured - just tested with ENCTYP back in the form HTML and it worked fine - let's hope that's it SmileSmileSmile

Boy am I pleased, it's been quite a ride these last few days - interesting though, I've learned some stuff along the way, primary lesson: "don't try and fix it if it already works" (lol)

Thanks Alex (and Paul) for all your help, without your guidance I would have still been going around in circles - your like a pair of Good Samaritans, only with Perl codebooks instead of bible's Smile

All the best
Shaun