Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

grantm (164)

grantm
  (email not shown publicly)
http://www.mclean.net.nz/

Just a simple [cpan.org] guy, hacking Perl for fun and profit since way back in the last millenium. You may find me hanging around in the monestary [perlmonks.org].

What am I working on right now? Probably the Sprog project [sourceforge.net].

GnuPG key Fingerprint:
6CA8 2022 5006 70E9 2D66
AE3F 1AF1 A20A 4CC0 0851

Journal of grantm (164)

Tuesday August 05, 2008
06:06 AM

Perl 5.6.2 hates me

[ #37098 ]

I was feeling virtuous for having finally made the time to address the RT queue for XML::SAX. After resolving 7 tickets I pushed out a new release and within about an hour I'd learned from the CPAN testers that the new release doesn't work with 5.6 (yay for CPAN testers!). The thing that's puzzling me is that I can't see how it ever worked.

Having compiled up a 'fresh' copy of Perl v5.6.2, I'm now able to see what the CPAN Testers are seeing. Here's a minimal test case:

$ perl -le 'q{TEST} =~/^[\x{0041}-\x{005A}]+$/ && print q{OK}'
Invalid [] range "}-\x" before HERE mark in regex m/^[\x{0041}-\x << HERE {005A}]+$/

The same thing works as expected on 5.8. The XML::SAX::PurePerl parser makes extensive use of this syntax (character classes which include ranges of unicode characters) to match productions such as these from the XML spec. It's been that way since 2002 and apparently working (modulo a few bugs). Indeed if I go back to the code in the previous release it passes all the tests - even with regexes that look like that.

I'm going to bed and hoping this makes more sense in the morning.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I tossed and turned in bed for a while and suddenly the solution was obvious:

    $ perl -le 'use utf8; q{TEST} =~/^[\x{0041}-\x{005A}]+$/ && print q{OK}'
    OK

    How soon we forget!

    • I can't tell you how many times something similar has happened to me. I keep a notepad by the bed when that happens as I know I will popup from sleep with an "Ah ha!".

  • Now that's resolved and I've uploaded a new release I can go back to bed :-)