# $W={} can get somehow created very easily.
cluck "W not empty:\n".Dumper($W) if keys(%$W);
- $W=bless My::Hash->new({}),$class;
- $W=My::Hash->new($W,"My::Hash::Sub","My::Hash::Push");
+ $W=My::Hash->new({},"My::Hash::Sub","My::Hash::Push");
+ bless $W,$class;
%$W=(
"__PACKAGE__"=>scalar(caller()),
%WebConfig,
};
if (!defined $W->{"have_style"}) {
- $W->{"have_style"}=(!$W->{"browser"}->netscape() || ($W->{"browser"}->major() && $W->{"browser"}->major()>4) ? 1 : 0);
+ $W->{"have_style"}=sub {
+ # Lazy-evaluation, we may not need the "User-Agent" header at all.
+ return our $r||=(!$W->{"browser"}->netscape() || ($W->{"browser"}->major() && $W->{"browser"}->major()>4) ? 1 : 0);
+ };
}
$W->{"have_js"}=($W->{"args"}{"have_js"} ? 1 : 0);
exit;
}
+sub footer_packages_used_comments()
+{
+ my $packages_used=$packages_used_array{$W->{"__PACKAGE__"}};
+ for my $package (@$packages_used) {
+ my $cvs_id=(eval('$'.$package."::CVS_ID")
+# || $package # debug
+ );
+ Wprint '<!-- '.$package.' - $'.$cvs_id.'$ -->'."\n" if $cvs_id;
+ }
+}
+
sub footer()
{
cluck 'Explicit &footer call is deprecated, !_exit_dne' if !$W->{"_exit_done"};
Wprint "</p>\n";
}
- for my $package (@$packages_used) {
- my $cvs_id=(eval('$'.$package."::CVS_ID")
-# || $package # debug
- );
- Wprint '<!-- '.$package.' - $'.$cvs_id.'$ -->'."\n" if $cvs_id;
- }
+ packages_used_comments();
do { Wprint $_ if $_; } for $W->{"footing"};