X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=Web.pm;h=3e7f05e2d53f8b9ce86acc5b65743886ab496b08;hb=f3783b57b1539a73fbe41981a379fb06d9f8955b;hp=cf0291530b2886eee818edfd2ff46b9863f16c25;hpb=22a01f144d28d1835744f03ddc2d03ac00d24d31;p=MyWeb.git diff --git a/Web.pm b/Web.pm index cf02915..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. } @@ -289,6 +291,7 @@ sub fatal (;$) my($msg)=@_; $msg="UNKNOWN" if !$msg; + cluck "FATAL: $msg"; $W->{"indexme"}=0; # For the case no heading was sent yet. $W->{"heading_done"}=0; # for the case of already sent {"header_only"}==1