X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/11fa40de88d41c209614ad064f71994b1360a5b2..821e607e7760124765b4a5b00687990153d001ba:/common.inc.plp diff --git a/common.inc.plp b/common.inc.plp index 0f79b83..563c0e4 100644 --- a/common.inc.plp +++ b/common.inc.plp @@ -8,7 +8,6 @@ use open ':std' => ':utf8'; use File::stat 'stat'; use HTTP::Date; -use Shiar_Sheet::KeySigns qw(%sign); $PLP::ERROR = sub { my ($text, $html) = @_; @@ -26,15 +25,16 @@ sub stylesheet { if (exists $get{style}) { $style = $styles{ $get{style} }; - require CGI::Cookie; - if (my $cookie = CGI::Cookie->new( - -name => 'style', - -value => $style, - -path => '/', # site-wide; current page is confusing to most users - -expires => $style ? '+5y' : '-1d', - )) { + eval { + require CGI::Cookie; + my $cookie = CGI::Cookie->new( + -name => 'style', + -value => $style, + -path => '/', # site-wide; current page is confusing to most users + -expires => $style ? '+5y' : '-1d', + ) or die "empty object returned\n"; AddCookie($cookie->as_string); - } + } or warn "Unable to create style cookie: $@"; } $style ||= exists $cookie{style} && $styles{ $cookie{style} } || $_[0]; @@ -99,8 +99,7 @@ sub Html { # leading output $header{content_type} = "text/html; charset=$meta->{charset}"; print <<"EOT"; - + @@ -119,11 +118,11 @@ EOT print <<"EOT";