in reply to XML::Simple add

I'd use XML::Simple. There are many examples on how to use it, a quick search will yield several (hopefully) relevant code samples, e.g.
--
Andreas

Replies are listed 'Best First'.
Re^2: XML::Simple add
by hakana (Acolyte) on Nov 28, 2007 at 08:28 UTC
    Tried the following but it doesn't save to file, how should I do that?
    my $conf = "/home/ember/devices/$Macaddress/$Macaddress.xml"; # create object my $xml = XMLin ($conf, KeepRoot=>1,); # insert element $xml->{dut}{ipaddress} = "$ipaddress"; $xml->{dut}{macaddress} = "$Macaddress"; $xml->{dut}{model} = "$ProdShortName"; $xml->{dut}{frimware} = "$Firmware_Version"; # convert Perl array ref into XML document print XMLout($xml);