Bug 88956 - perl-5.8.0-88 regex handling breaks autorpm with UTF-8 locale
Summary: perl-5.8.0-88 regex handling breaks autorpm with UTF-8 locale
Keywords:
Status: CLOSED DUPLICATE of bug 82652
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: perl
Version: 9
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chip Turner
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-04-15 17:58 UTC by Gilles Detillieux
Modified: 2007-04-18 16:53 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-02-21 18:52:41 UTC
Embargoed:


Attachments (Terms of Use)

Description Gilles Detillieux 2003-04-15 17:58:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
I realize this is a duplicate of bug #83652, but bugzilla isn't
letting me post additional comments to that bug report.

I have a problem with autorpm-3.1-1.noarch.rpm (from autorpm.org)
failing on Red Hat 9, which I tracked down to a problem with Perl's
regex handling with UTF-8 locales.  I also tried the smaller test
case,

echo abc | perl -ne 'use locale;print if /[^\s]+/'

under Red Hat 8.0 (perl-5.8.0-55) and Red Hat 9 (perl-5.8.0-88) and
it works fine on Red Hat 8.0 with LANG=en_US.UTF-8, but under RH 9 it
fails with that LANG (but works with LANG=C or LANG=en_US).  Given
that it's the same version of perl on both systems, the problem must
lie somewhere in the utf-8 related patches in the 88 release.

The suggested workaround,

exec 'env', 'LANG=C', $0, @ARGV unless $ENV{"LANG"} eq "C";

works well for autorpm too.  Still, given that Perl scripts rely so
heavily on regular expressions, it would be kind of nice if they
actually worked with the UTF-8 locales (which Red Hat 8.0 & 9 use by
default).  Having to kludge all Perl scripts like this would get
really ugly, not to mention it would break scripts where you want
the LANG setting preserved.

Version-Release number of selected component (if applicable):
perl-5.8.0-88

How reproducible:
Always

Steps to Reproduce:
1. export LANG=en_US.UTF-8
2. echo abc | perl -ne 'use locale;print if /[^\s]+/'
    

Actual Results:  no output

Expected Results:  abc

Additional info:

Comment 1 Gilles Detillieux 2003-04-15 18:01:00 UTC
Sorry, I meant bug #82652.

*** This bug has been marked as a duplicate of 82652 ***

Comment 2 Gilles Detillieux 2003-04-16 17:03:01 UTC
I may have spoken too soon.  The suggested workaround,

exec 'env', 'LANG=C', $0, @ARGV unless $ENV{"LANG"} eq "C";

works as long as LANG is set.  If you put it in a script that may be run
from cron, like autorpm is, or anywhere else where LANG is not set, then
you'll get an error instead.  E.g.:

Use of uninitialized value in string eq at /usr/sbin/autorpm line 25.

Comment 3 Red Hat Bugzilla 2006-02-21 18:52:41 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.


Note You need to log in before you can comment on or make changes to this bug.