Tanktalus has asked for the wisdom of the Perl Monks concerning the following question:
Ok, this is a bit odd ... it took me a few hours to figure out why this didn't work:
The warning still showed. Yet if I ran the script as perl ./x.pl 2> /dev/null, well, it didn't show up. So no one is reopening anything, as my first guess supposed... and then I realised that it wasn't the warning (since a small test script didn't exhibit the same problem), but that I use diagnostics. It's only the diagnostics that show up. Ugh.my $s = do { # don't care about warnings. local *STDERR; open STDERR, '>', File::Spec->devnull(); code_that_warns_deep_in_core_perl(); # and I can't figure out why };
So, first question: does anyone else consider it a bug that the above doesn't DWIM when using diagnostics?
Second question is ... has anyone had any problems with codepage conversions causing:
(That's the line that says:Use of uninitialized value in lc at /usr/lib/perl5/5.8.7/utf8_heavy.pl line 123.
) I haven't been able to pare it down, unfortunately, to a smaller working example. The idea is that I'm reading some XML files (XML::Twig), getting the text from there, and then doing some funkiness with the text to modify it based on data I get from elsewhere. I split the text using a reasonably complex regexp (for a split, anyway), and then I uc some of it. This, apparently, causes perl to go into utf8_heavy's utf8::SWASHNEW method where it tries to lc something that I don't get.if (my $base = ($utf8::Canonical{$canonical} || $utf8::Canonical{ lc $ +utf8::PropertyAlias{$canonical} })) {
I've even tried to use Encode::decode to decode the UTF-8 from the XML file, but no change in behaviour (that I've noticed) there. Any clues would be appreciated. Meanwhile, I'm going to continue trying to pare down to a minimal-working example that gets the same error.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: diagnostics, STDERR, and codepage conversions (TFM)
by tye (Sage) on Aug 13, 2007 at 17:14 UTC | |
by Tanktalus (Canon) on Aug 13, 2007 at 20:36 UTC | |
by tye (Sage) on Aug 13, 2007 at 21:43 UTC | |
by Tanktalus (Canon) on Aug 13, 2007 at 22:49 UTC |