Re: Problems with use locale and regexp



my $content = Encode::decode("iso-8859-15"
,"[[lmo:Met\xE0jalcal\xEDtt]]\n");

sorry for the newline in the code :(

On 29 Dez., 12:16, felix.ostm...@xxxxxxxxx wrote:
It is realy strange!

first the code:
#####################################
#!/usr/bin/perl

use strict;
use warnings;
use locale; ## WONT WORK
use Encode;

my $content = Encode::decode("iso-8859-15","[[lmo:Met\xE0j
alcal\xEDtt]]\n");

$content =~ s!^\[\[[a-z]{2}:.*\]\]$!!gm; ## WONT WORK
# $content =~ s!^\[\[[a-z]{2}:.*\]$!!gm; ## WORK

print $content;
#####################################

This bug? shocked me when i was parsing wikipedia-data.
after 69 articles my importprocess stops ... but he use many cpu-time
... strange.

after some hours i found out that this small code can reproduce the
error. he cant execute the pattern.

without "use locale;" it works. With the second regexp ist works!
(search for only one \] at the end of the line).

I cant believe ... i think he must find out after "[[lmo:" that the
string dont match, why is the \]\] at the end so basic?

Why this affect only after "use locale;"? i set the locale to
POSIX,C,en_GB or de_DE, nothing :( wont work!

What is to do?

.



Relevant Pages

  • Re: Problems with use locale and regexp
    ... You don't say what "WONT WORK" actually means. ... locale in effect. ... That certainly is a bug and if it's still in the ... I assume you are aware that you regex doesn't match (it shouldn't ...
    (comp.lang.perl.misc)
  • Problems with use locale and regexp
    ... It is realy strange! ... This bug? ... without "use locale;" it works. ... POSIX,C,en_GB or de_DE, nothing:(wont work! ...
    (comp.lang.perl.misc)
  • Re: Matching umlauts
    ... use strict; ... use warnings; ... use POSIX qw; ... Before locale in effect: ...
    (comp.lang.perl.misc)
  • RE: etch upgrade problem (SOLVED)
    ... difference was due to gnome vs. kde or killing the screensaver process ... Now on to the PERL locale variable warnings. ...
    (Debian-User)
  • Re: reportbug locale complaints
    ... Chris Metzler wrote: ... I've been getting warnings about my locale when I start ... To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org ...
    (Debian-User)