in reply to Problem with CGI::XML

I think that the results you are getting is exactly as expected. If you are accessing "script.pl?keywords=hai", CGI::XML (actually XML::CGI as it turns out) is going to write up the XML in such a manner that you can see the argument name and its value. (I think I got that right...)

If you are only trying to create an XML output of <cgi>hai</cgi> and the such, where parameters passed to CGI have nothing to do with it, check out XML::Simple. Then you could do something like this:

#!/usr/bin/perl -w use strict; use XML::Simple; my $xml; $xml->{'cgi'} = 'hai'; print XMLout( $xml, keeproot => 1 );

To make things even cooler, you can place the output of XMLout() to a file and then use the XMLin() function to bring it back in and read from the structure:

my $xml = XMLin( 'file.txt', keeproot => 1 ); print $xml->{'cgi'};

See XML::Simple Documentation for more of the juicy details.


      C:\>shutdown -s
      >> Could not shut down computer:
      >> Microsoft is logged in remotely.