I am moving a Perl CGI script from one server (Perl 5.005 w/CGI.pm 2.46) to another (Perl 5.8.0 w/CGI.pm 2.94 -- latest) and am noticing some strange behavior with CGI::XMLForm (both servers have version 0.10 of that module)
It starts out like this:
use CGI::XMLForm;
my $q = new CGI::XMLForm;
Then various parameters from the HTTP POST are added, deleted, modified in $q by a subroutine. Back in "main" after the subroutine, when I dump out the parameters & values from $q I get output like this:
Name: /strega/header/id
Value: 519
Name: /strega/header/type
Value: P
Name: /strega/header/options
Value: exe_opt.dat
Name: /strega/header/file
Value: prod.xml.dat
I know these will produce appropriately tagged & nested XML. But then when I try to convert it to XML like this:
$finalXML = $q->toXML;
... when I print out $finalXML, the XML gets generated based on the original $q parameters and values, not the ones that have been cleaned up. And oddly enough it works on the old platform. I have tried cloning $q but run into a different problem. I have a feeling I am making a mistake related to handling of objects in perl. Can anyone help? Thanks.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.