#!/usr/bin/perl -w use strict; my $sitefile='/app/sites.xml'; my $twig=new XML::Twig; $twig -> parsefile($sitefile); my %hash = (name=>"name3",address=>"address3",contact=>"contact3"); my $root=$twig->root; my $insert = $root->insert_new_elt('last_child', site => {siteid=>"THR +EE"}); foreach my $element (keys %hash){ $insert->insert_new_elt('last_child',$element,$hash{$element}) } $root->print;
Regards,
Murugesan Kandasamy
use perl for(;;);
In reply to Re: adding XML records using XML::Twig
by murugu
in thread adding XML records using XML::Twig
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |