From f3783b57b1539a73fbe41981a379fb06d9f8955b Mon Sep 17 00:00:00 2001 From: short <> Date: Thu, 13 Jan 2005 16:23:52 +0000 Subject: [PATCH] Fixed warn for 'Wuse' before setting $W->{"__PACKAGE__"}. --- Web.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Web.pm b/Web.pm index c6a0452..3e7f05e 100644 --- a/Web.pm +++ b/Web.pm @@ -46,9 +46,11 @@ BEGIN $file.=".pm"; my $who=$W->{"__PACKAGE__"}; $who||="__My::Web" if $W->{"__My::Web_init"}; - my $aref=($W->{"packages_used"}{$who}||=[]); - push @$aref,$class - if !{ map(($_=>1),@$aref) }->{$class}; # Prevent duplicated entries. + if ($who) { + my $aref=($W->{"packages_used"}{$who}||=[]); + push @$aref,$class + if !{ map(($_=>1),@$aref) }->{$class}; # Prevent duplicated entries. + } CORE::require $file; 1; # Otherwise 'require' would already file above. } -- 1.8.3.1