This thread is in continuation of Perl script to populate an XML file.
The file I want to change is:
<?xml version="1.0" encoding="UTF-8"?>
<configuration start="earth">
<country-list>
<country name="japan">
<description></description>
<start>1900</start>
<end/>
</country>
<country name="italy">
<description></description>
<start>1950</start>
<end/>
</country>
<country name="korea">
<description></description>
<start>1800</start>
<end/>
</country>
</country-list>
</configuration>
I want to add a new country here in this list.
In previous question, Perl script to populate an XML file.
#Get the list of cities as a list, then push "Tokyo" to it.
push @{$doc->{countries}->{country}->{'japan-'}->{city}}, 'Tokyo';
This was suggested to add a new tag, but in my case not sure how exactly can I use "push". I am not able to map to the correct tag.