From f0a8fd683c572d39673f9b0a22fd4919c1bed5a7 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 6 Feb 2010 18:16:57 +0000 Subject: [PATCH] Some tiding of warnings::__chk(). Remove my $this_pkg, rendered unused by 4f527b719ae89076. Move $pkg inside the if() block. Don't needlessly assign to $i. --- lib/warnings.pm | 6 +++--- warnings.pl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/warnings.pm b/lib/warnings.pm index defc208..10a7cbf 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -458,11 +458,11 @@ sub __chk unless defined $offset ; } - my $this_pkg = (caller(1))[0] ; - my $i = 2 ; - my $pkg ; + my $i; if ($isobj) { + my $pkg; + $i = 2; while (do { { package DB; $pkg = (caller($i++))[0] } } ) { last unless @DB::args && $DB::args[0] =~ /^$category=/ ; } diff --git a/warnings.pl b/warnings.pl index 514ccd7..59d8652 100644 --- a/warnings.pl +++ b/warnings.pl @@ -743,11 +743,11 @@ sub __chk unless defined $offset ; } - my $this_pkg = (caller(1))[0] ; - my $i = 2 ; - my $pkg ; + my $i; if ($isobj) { + my $pkg; + $i = 2; while (do { { package DB; $pkg = (caller($i++))[0] } } ) { last unless @DB::args && $DB::args[0] =~ /^$category=/ ; } -- 2.7.4