From bea23facc1644cffa53ecc84fa236806e9c94dfd Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Thu, 8 Dec 2011 18:47:26 +1030 Subject: Silence genutf8.pl warnings across Perl versions - Use Perl filehandles directly since IO::Handle generates unicode warnings that can't be silenced. - Disable all warnings since the specific "nonchar" warning only exists in newer versions. --- tests/genutf8.pl | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/tests/genutf8.pl b/tests/genutf8.pl index bbef91f..db661a1 100755 --- a/tests/genutf8.pl +++ b/tests/genutf8.pl @@ -2,31 +2,22 @@ # Create test comparison data using a different UTF-8 implementation. -# The generation utf8.dat file must have the following MD5 sum: +# The generated utf8.dat file must have the following MD5 sum: # cff03b039d850f370a7362f3313e5268 use strict; -use warnings; -use FileHandle; # 0xD800 - 0xDFFF are used to encode supplementary codepoints # 0x10000 - 0x10FFFF are supplementary codepoints my (@codepoints) = (0 .. 0xD7FF, 0xE000 .. 0x10FFFF); -my ($utf8); -{ - # Hide "Unicode character X is illegal" warnings. - # We want all the codes to test the UTF-8 escape decoder. - no warnings; - $utf8 = pack("U*", @codepoints); -} +my $utf8 = pack("U*", @codepoints); defined($utf8) or die "Unable create UTF-8 string\n"; -my $fh = FileHandle->new(); -$fh->open("utf8.dat", ">:utf8") +open(FH, ">:utf8", "utf8.dat") or die "Unable to open utf8.dat: $!\n"; -$fh->write($utf8) +print FH $utf8 or die "Unable to write utf8.dat\n"; -$fh->close(); +close(FH); # vi:ai et sw=4 ts=4: -- cgit v1.2.3-55-g6feb