dalgetty has asked for the wisdom of the Perl Monks concerning the following question:
It worked beautifully until I started to test the boundaries. With huge chunks of XML it works fine, with smallish ones also, for example:sub init() { my ($self)=@_; my $source=$self->matrix; foreach my $node(keys (%$source)) { my $elem=$source->{$node}; my $count=0; foreach my $attr (@$elem) { ##### line 60 $self->print.="\n\n$node $count\n\n"; if ($count<1) {$self->nodename=$node;} foreach my $subnode(keys(%$attr)) { $self->print.=$subnode."\t".$attr->{$subnode}."\n"; } $count++; } } }
However, if there is only one element, such as:<root> <car> <make>audi</make> </car> <car> <make>sbarro</make> </car> </root>
Then I get this error: Not an ARRAY reference at transForm.pm line 60.<root> <car> <make>audi</make> </car> </root>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple, but not for me
by Corion (Patriarch) on May 01, 2007 at 09:57 UTC | |
by dalgetty (Acolyte) on May 01, 2007 at 15:27 UTC |