Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Consider using the numerical comparison operators. You're dealing with numbers, so you shouldn't compare them as strings.
Try if ($ParentNodeId > 1) { instead of if ($ParentNodeId gt 1) {. Replace eq with ==.
While I'm here, can I suggest you use a hash for the input data, instead of that long list of variables? First define a list of field names:
Then replace the split line with Then when you set the attributes on the XML::Twig::Elt, you can simply say:
In reply to Re: Need help with XML::Twig, something strange is happening!!
by rhesa
|
|