in reply to Need help with XML::Twig, something strange is happening!!
Try if ($ParentNodeId > 1) { instead of if ($ParentNodeId gt 1) {. Replace eq with ==.
Then replace the split line withmy @field_names = qw/ ParentNodeId NodeId level canode label theme tem +plate /; # and so on for the rest
Then when you set the attributes on the XML::Twig::Elt, you can simply say:my %attributes; @attributes{ @field_names } = split /,/, $line;
$esec->set_att( %attributes );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need help with XML::Twig, something strange is happening!!
by stevee (Acolyte) on Mar 28, 2007 at 14:02 UTC |