All pastes #823320 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-12-19 08:46 UTC
rendered paste body
#!/usr/bin/perl

use XML::Twig;

my $Twig = new XML::Twig( pretty_print => 'indented');
eval { $Twig->parsefile("/root/IP.xml") };
print "Caught error: $@\n" if $@;
my $root = $Twig->root;

my $Red_Ifc;
my $ether;
$i = 0;

foreach $ether ($root->children('Config'))
{
        if($i == 1)
        {
                $ether->first_child('Ethernet')->set_text("eth10");
        }
        $i++;
}
$root->print;
$root->print_to_file("/root/one.xml");