I think the problem is that the hashref returned from CGI::Vars() is a tied hashref, which XMLout doesn't seem to like. Making a copy of it as shown below seems to 'avoid' the problem.
#! perl -w use strict; use CGI; use XML::Simple; my $cgi= new CGI; my $xs = new XML::Simple(); my $elements = $cgi->Vars(); my %copy = %$elements; my $xml = $xs->XMLout(\%copy, rootname => 'source'); print $xml; __DATA__ #output C:\test>184342 "test=1&fred=bill&something=somethingelse" '<source fred="bill" something="somethingelse" test="1" />
Update: Removed redundant use of Data::Dumper.
In reply to Re: XML from CGI parameters
by BrowserUk
in thread XML from CGI parameters
by ezekiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |