From: Dave Rolsky Date: Fri, 15 Apr 2011 16:10:00 +0000 (-0500) Subject: Don't disable 'once' warnings in the whole test X-Git-Tag: 2.0100~65 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ba256d553b96320f3068a3dace8e8cc5bc2a21b;p=gitmo%2FMoose.git Don't disable 'once' warnings in the whole test --- diff --git a/t/type_constraints/util_std_type_constraints.t b/t/type_constraints/util_std_type_constraints.t index c830567..f1ea003 100644 --- a/t/type_constraints/util_std_type_constraints.t +++ b/t/type_constraints/util_std_type_constraints.t @@ -28,8 +28,7 @@ my $ARRAY_REF = []; my $HASH_REF = {}; my $CODE_REF = sub { }; -no warnings 'once'; # << I *hates* that warning ... -my $GLOB = *GLOB_REF; +my $GLOB = do { no warnings 'once'; *GLOB_REF }; my $GLOB_REF = \$GLOB; open my $FH, '<', $0 or die "Could not open $0 for the test"; @@ -37,8 +36,8 @@ open my $FH, '<', $0 or die "Could not open $0 for the test"; my $FH_OBJECT = IO::File->new( $0, 'r' ) or die "Could not open $0 for the test"; -my $REGEX = qr/../; -my $REGEX_OBJ = bless qr/../, 'BlessedQR'; +my $REGEX = qr/../; +my $REGEX_OBJ = bless qr/../, 'BlessedQR'; my $OBJECT = bless {}, 'Foo';