5 no warnings 'qw'; # you know what you doing
6 no warnings 'uninitialized'; # save some useless checks for more legible code
7 use open IO => ':utf8';
11 $header{content_type} = 'text/html; charset=utf-8';
14 my %styles = map {$_ => $_} @_;
16 if (exists $get{style}) {
17 $style = $styles{ $get{style} };
19 AddCookie(CGI::Cookie->new(
22 -path => '/', # site-wide; current page is confusing to most users
23 -expires => $style ? '+5y' : '-1d',
27 $style ||= exists $cookie{style} && $styles{ $cookie{style} } || $_[0];
29 return join "\n", map { sprintf(
30 '<link rel="%s" type="text/css" media="all" href="%s" title="%s">',
31 $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css", $_