From: Steffen Mueller Date: Thu, 3 Sep 2009 08:45:17 +0000 (+0200) Subject: Silence more deprecation warnings in compatibility tests for Getopt::Long X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b814bbfa9a2087bc9c1208d2ca690faeec84362a;p=p5sagit%2Fp5-mst-13.2.git Silence more deprecation warnings in compatibility tests for Getopt::Long --- diff --git a/lib/Getopt/Long/t/gol-compat.t b/lib/Getopt/Long/t/gol-compat.t index c123ef2..fe4f746 100644 --- a/lib/Getopt/Long/t/gol-compat.t +++ b/lib/Getopt/Long/t/gol-compat.t @@ -9,7 +9,17 @@ BEGIN { } } -require "newgetopt.pl"; +{ + # Silence the deprecation warnings from newgetopt.pl for the purpose + # of testing. These tests will be removed along with newgetopt.pl in + # the next major release of perl. + local $SIG{__WARN__} = sub { + if ($_[0] !~ /deprecated/) { + print(STDERR @_); + } + }; + require "newgetopt.pl"; +} print "1..9\n";