Raghu.S has asked for the wisdom of the Perl Monks concerning the following question:
--------------#!/usr/bin/perl use XML::Simple qw/XMLin/; use XML::Simple; use Data::Dumper qw/Dumper/; use File::Basename qw/dirname basename fileparse/; use IPC::Open2 qw/open2/; use Getopt::Long qw/GetOptions/; my $config = XMLin('./appsimage_EBSB4.xml'); print Dumper($config);
cat ./appsimage_EBSB4.xml
----------------<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE clone[ <!ENTITY envPageConfig SYSTEM "./envPageConfig.xml"> ]> <clone-config> "\&envPageConfig"; </clone-config> -------------------- cat ./envPageConfig.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE clone[ <!ENTITY envPageConfig SYSTEM "./envPageConfig.xml"> ]> <clone-config> "&envPageConfig"; </clone-config> ohpr434:EBSB11:/home/oracle/test$cat envPageConfig.xml <comt4> <bolinfpwd>welcome</bolinfpwd> </comt4>
When I execute test.pl
-----------------------$VAR1 = { 'comt4' => [ { 'bolinfpwd' => 'welcome' }, { 'bolinfpwd' => 'welcome' }, { 'bolinfpwd' => 'welcome' } ] };
Can you help me limiting this array to single value which is the ideal case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Duplicate entries with nested xml
by tobyink (Canon) on Sep 04, 2014 at 09:22 UTC | |
|
Re: Duplicate entries with nested xml
by karlgoethebier (Abbot) on Sep 04, 2014 at 13:35 UTC | |
by tobyink (Canon) on Sep 04, 2014 at 16:38 UTC | |
by karlgoethebier (Abbot) on Sep 04, 2014 at 18:09 UTC | |
by Jenda (Abbot) on Sep 05, 2014 at 15:43 UTC |