Fixed warn for 'Wuse' before setting $W->{"__PACKAGE__"}.
authorshort <>
Thu, 13 Jan 2005 16:23:52 +0000 (16:23 +0000)
committershort <>
Thu, 13 Jan 2005 16:23:52 +0000 (16:23 +0000)
Web.pm

diff --git a/Web.pm b/Web.pm
index c6a0452..3e7f05e 100644 (file)
--- 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.
        }