AnnoCPAN::XMLCGI - Read XML input through a CGI.pm-like interface
use AnnoCPAN::XMLCGI; my $cgi = AnnoCPAN::XMLCGI->new; my $name = $cgi->param('name'); print $cgi->header; print "Hello, $name!\n"; # Hello, Bob! # In STDIN... <data> <name>Bob</name> <age>123</age> <data>
Note that only a very minimal subset of CGI is implemented, but it is the only part that is required for most simple uses.
The input stream is expected to be a very simple XML structure with only one level of depth, and with no duplicate keys. The root element (<data> in the example above) can be have any tag name.
Create an AnnoCPAN::XMLCGI object. Doesn't take any parameters. When called, it slurps everything in STDIN; therefore it's not a very good idea to call it more than once.
Returns false if there was a parsing error.
Return the value of the parameter $name. Note that, unlike CGI, it doesn't handle multiple values.
Returns a very simple header ("Content-type: text/html; charset=UTF-8\n\n").
Ivan Tubert-Brohman <email@example.com>
Copyright (c) 2005 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.