go ahead... be a heretic | |
PerlMonks |
Re: Help with XML::Writerby OeufMayo (Curate) |
on Sep 01, 2001 at 04:09 UTC ( [id://109581]=note: print w/replies, xml ) | Need Help?? |
First, I don't think the code you posted work as you expect. The the elements of the two arrays (@Name and @Address must be enclosed between parens. Otherwise, you will only get the first element of the array. Secondly, I find a bit cumbersome the way your datas are divided in two arrays, one for the names and one for the addresses, unless they are provided to you in this way, I would suggest you put all the user information in an array (or a hash), and put all these arrays into a big one (see perldsc for more infos on data structures.) Now, about XML::Writer, it tend to agree with Mr. Q&A,
I don't like the File::IO voodoo thing you have to do, so
I prefer just printing the XML to STDOUT.
Oh, and I'll probably lowercase the name of all the XML elements, but that's just me, maybe you can't do that in your application... <kbd>--my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>
In Section
Seekers of Perl Wisdom
|
|