Blosxom, a weblog application, exports a global variable $header which is a reference to hash. This application passes $header CGI::header() to generate HTTP headers.
When plugin developers modify HTTP headers, they must write as follows:
package foo;
$blosxom::header->{'-status'} = '304 Not Modified';
It's obviously bad practice. Blosxom misses the interface to modify them.
Blosxom::Header is a Perl module that allows you to modify them in an object-oriented way:
my $h = Blosxom::Header->new($blosxom::header);
$h->set(Status => '304 Not Modified');
You don't need to mind whether to put a hyphen before a key, nor whether to make a key lowercased or camelized.
SYNOPSIS
# blosxom.cgi
package blosxom;
our $header = { -type => 'text/html' };
# plugins/foo
package foo;
use Blosxom::Header;
my $h = Blosxom::Header->new($blosxom::header);
my $value = $h->get('type');
my $bool = $h->exists('type');
$h->set( type => 'text/plain' );
$h->remove('type');
Product's homepage
Requirements:
· Perl
What's New in This Release: [ read full changelog ]
· push_p3p_tags() is obsolete and will be removed in 0.07
· new() become a private method, not the alias of instance() any more
· Add EXAMPLES to POD