CGI::XML â Perl extension for converting CGI.pm variables to/from XML
| Use Case | Command | Description |
|---|---|---|
| Create instance | $q = new CGI::XML; |
Reads CGI parameters just like CGI.pm |
| CGI â XML | $xml = $q->toXML; |
Convert all CGI variables to XML (no root element by default) |
| CGI â XML (with root) | $xml = $q->toXML('cgi'); |
Wrap the generated XML in a <cgi> root element |
| XML â CGI | $q->toCGI($xml); |
Parse XML and populate CGI parameters (overwrites existing values) |
use CGI::XML;
$q = new CGI::XML;
# convert CGI.pm variables to XML
$xml = $q->toXML;
$xml = $q->toXML($root);
# convert XML to CGI.pm variables
$q->toCGI($xml);
The CGI::XML module converts CGI.pm variables to XML and vice versa.
CGI::XML is a subclass of CGI.pm, so it reads the CGI variables just as CGI.pm would.
$q = new CGI::XML$q->toXML([$root])$q->toCGI($xml)CGI::XML does not currently handle multiple selections passed from HTML forms. This will be added in a future release.
Jonathan Eisenzopf <eisen AT pobox.com>
David Black <dblack AT candle.net>
Generated by phpman v4.9.26-5-g7740029 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-18 20:00 @216.73.216.177
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)