Red Angel has asked for the wisdom of the Perl Monks concerning the following question:

When using RedHat Linux version 9, I (for the first time) started getting Unexpected End-Of-String messages from PERL when using PERL's split() function. I suspect (though I am not sure) that this is because RedHat 9 uses PERL 5.8 (while other systems, even some that were relased later use PERL 5.6.1.

I find this "feature" to be very problematic, because when I call split(), I'm not asking it for it's opinion on whether or not the strintg is terminated in the manner it expects - I'm just asking it to split the string according to the specified pattern, and I *need* for it to do it's job without complaining.

My question is this: Is this new behavior something I'm going to have to get used to with PERL? And if so, how can I do things that I used to rely on the split() function for?

Replies are listed 'Best First'.
Re: split() RH-9 and PERL 5.8
by dave_the_m (Monsignor) on May 13, 2004 at 21:25 UTC
    You don't give any actual code examples, but I suspect that you're running into the infamous RH9/5.8.0 locale problem. In that release, Redhat set the locale to utf8 by default, eg LANG=en_US.utf8, and Perl 5.8.0 takes that as a sign to treat all input and output files as UFT8 encoded.

    The two solutions to this are to remove the .utf8 suffix from any locale-related environment variables, or upgrade to Perl 5.8.1 or later.

    Dave.

      The specific script I'm referring to is the ufsearch program in boxenv. I know that the chword program also uses split(), but I just can't remember whether or not that was also having the same problem with RedHat 9 (though I think it was too).
        The specific script I'm referring to is the ufsearch program in boxenv
        Thats got to be the worst Perl script I have seen in many a long age! Anyway, back to the original point - does your problem go away if you change the locale or the Perl version?
Re: split() RH-9 and PERL 5.8
by Fletch (Bishop) on May 14, 2004 at 04:02 UTC

    FYI: Perl is the language, perl is the interpreter. PERL is just wrong.</unrelated rant>