Re: Help generating XML output

2007-10-25 Thread Dr.Ruud
"Jenda Krynicky" schreef: > I see. Well I'd probably get a little lost in all those braces for a > second so > > map { > $gen->user( {id => $ref->{$_}}, $_) > } keys %{$ref} > > would probably be better. You could write that as: map $gen->user( { id => $ref->{$_} }, $_ ), keys %$re

Re: Help generating XML output

2007-10-24 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > From: Rob Dixon <[EMAIL PROTECTED]> > >> Well yes, of course that's possible. But you're advocating abandoning > >> strictures and writing unintelligible code by proposing it. > > > > Beg your pardon? use strict doesn't

Re: Help generating XML output

2007-10-24 Thread Rob Dixon
Jenda Krynicky wrote: From: Rob Dixon <[EMAIL PROTECTED]> Jenda Krynicky wrote: It's just a matter of one map(): #!perl use XML::Generator; $ref = { 'dermot' => '10', 'joe' => '17', 'rose' => '11', 'phil' => '13', 'brian' => '20',

Re: Help generating XML output

2007-10-23 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > It's just a matter of one map(): > > > > #!perl > > use XML::Generator; > > > > $ref = { > > 'dermot' => '10', > > 'joe' => '17', > > 'rose' => '11', > > 'phil' => '13', > > 'brian' => '20', > >

Re: Help generating XML output

2007-10-23 Thread Rob Dixon
Jenda Krynicky wrote: From: Rob Dixon <[EMAIL PROTECTED]> I am unfamiliar with XML::Generator, but have experimented with it for the purposes of your question and it seems to be essentially a translator that will convert a Perl fragment into an XML fragment, and I can see no way to modify existi

Re: Help generating XML output

2007-10-23 Thread Beginner
On 23 Oct 2007 at 16:46, Jenda Krynicky wrote: > From: "Beginner" <[EMAIL PROTECTED]> > > On a more general point I haven't found it easy to find modules > that > > output XML or perhaps I should say, I didn't find the ones I did > look > > at to be well documented in terms of examples or show t

Re: Help generating XML output

2007-10-23 Thread Jenda Krynicky
From: "Beginner" <[EMAIL PROTECTED]> > On a more general point I haven't found it easy to find modules that > output XML or perhaps I should say, I didn't find the ones I did look > at to be well documented in terms of examples or show the variety of > different ways data structures can be repre

Re: Help generating XML output

2007-10-23 Thread Beginner
On 23 Oct 2007 at 14:21, Jenda Krynicky wrote: > From: Rob Dixon <[EMAIL PROTECTED]> > > I am unfamiliar with XML::Generator, but have experimented with it > for > > the purposes of your question and it seems to be essentially a > translator > > that will convert a Perl fragment into an XML fragme

Re: Help generating XML output

2007-10-23 Thread Jenda Krynicky
From: Rob Dixon <[EMAIL PROTECTED]> > I am unfamiliar with XML::Generator, but have experimented with it for > the purposes of your question and it seems to be essentially a translator > that will convert a Perl fragment into an XML fragment, and I can see no > way to modify existing XML. Because o

Re: Help generating XML output

2007-10-23 Thread Rob Dixon
Beginner wrote: I have been trying to output XML that looks like this: dermot joe ... I have tried XML::Simple and XML::Generator but keep hitting the same problem when it comes to separating the id attribute and the value from my hash reference. $VAR1 = { 'der

Re: Help generating XML output

2007-10-23 Thread Beginner
On 23 Oct 2007 at 12:12, Rob Coops wrote: > foreach my $k (keys %{$ref}) { > $xml = $gen->users( # $xml gets over written with every new > key So instead of doing that I would try $xml .= (appending) > $gen->username({ id => $ref->{$k}},$k), >

Re: Help generating XML output

2007-10-23 Thread Rob Coops
foreach my $k (keys %{$ref}) { $xml = $gen->users( # $xml gets over written with every new key So instead of doing that I would try $xml .= (appending) $gen->username({ id => $ref->{$k}},$k), ); } On 10/23/07, Beginner <[EMAIL

Help generating XML output

2007-10-23 Thread Beginner
Hi, I have been trying to output XML that looks like this: dermot joe ... I have tried XML::Simple and XML::Generator but keep hitting the same problem when it comes to separating the id attribute and the value from my hash reference. $VAR1 = { 'dermot' => '10',