Skip Menu |

This queue is for tickets about the Class-Base CPAN distribution.

Report information
The Basics
Id: 75286
Status: resolved
Priority: 0/
Queue: Class-Base

People
Owner: Nobody in particular
Requestors: chromatic [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Silence "Used only once" warning with $DEBUG
This patch silences the "used only once" warning which accessing the calling package's $DEBUG variable will generate if said variable does not exist. "no warnings 'once';' would also work, though that does impose a Perl 5.6 minimum version requirement.
Subject: 0001-Worked-around-used-only-once-warning-with-DEBUG.patch
From 89bfcc6853dd4df75ee7f596ac87bc2c3412dd4e Mon Sep 17 00:00:00 2001 From: chromatic <chromatic@wgz.org> Date: Fri, 24 Feb 2012 16:12:02 -0800 Subject: [PATCH] Worked around 'used only once' warning with $DEBUG. --- lib/Class/Base.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/Class/Base.pm b/lib/Class/Base.pm index aa9c157..cdcdb19 100644 --- a/lib/Class/Base.pm +++ b/lib/Class/Base.pm @@ -48,7 +48,7 @@ sub new { ? $config->{ debug } : defined $config->{ DEBUG } ? $config->{ DEBUG } - : ( ${"$class\::DEBUG"} || 0 ); + : ( do { local $^W; ${"$class\::DEBUG"} } || 0 ); my $self = bless { _ID => $config->{ id } || $config->{ ID } || $class, -- 1.7.4.1
applied. BTW the sourece is here: https://github.com/szabgab/Class-Base