Perl regular expression does not work on 5.8.0

S

Stefan Rupp

Good afternoon,

we have a perl regular expression which always worked for us on
Solaris(SPARC) HPUX(IA64) and Debian GNU/Linux(i386). But now I have to
install a software on a RedHat based GNU/Linux i386 box and the same
expression does not work any longer.

See the following script:

----------------------------------------------------------
#!/usr/bin/perl

print "Enter lines with 'key = value'\n";

while ( <STDIN> ) {
if ( /^\s*([^\s=]+)\s*=\s*([^\"]\S*|\".*\")\s*/ ) {
print "Match! key = '$1', value = '$2'\n";
}
else {
print "No match.\n";
}
}
----------------------------------------------------------

On Debian (Woody) with Perl 5.6.1 it works, it matches lines like

a = b

On HPUX(IA64) with Perl 5.8.0 it works as well. On RedHat 9 with Perl
5.8.0 however, it does not match at all.

What am I doing wrong?

Any help is appreciated!

Regards,
Stefan
 
S

Stefan Rupp

Shalom!
I would just try "The Debian way"
and put
export LC_ALL="POSIX" [...]
into /etc/profile.

Brilliant, now it works like expected.
Yes, the old problem with db versions. Changing
locale settings as a work-around should do until
5.8.1 stable is available on RHN.

Thanks a lot!

Regards,
Stefan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top