ctions
use HTTP::Status;
use XML::Dumper;
XML::Dumper::dtd;
use JSON;
my %formats = (
xml => \&pl2xml,
json => sub { objToJson( $_[0], {pretty => 1, indent => 4} ) },
browser => \&browserpri
}
my %query = map { split /=/ } split /;/, lc $ENV{QUERY_STRING};
my $formatter = $formats{json};
$formatter = $formats{ $query{format} }
if (exists $query{format}
and exists
simply return any Perl data structure, which will be serialized into the requested format (XML or JSON or "browser prettyprint" format), or you can actually construct a page yourself, perhaps even usi