Hello taralon,
Welcome to the forum, a few short tips before answering your question. First of all please please use the
< code >
< /code >
code tags properly. There is a preview button before posting your question where you can see how your question/reply looks like before posting it.Second, it seems that you are not a beginner. Then why you do not try as much as possible before posting your question? By doing so you will learn the most out of programming and you will find so many useful information and examples online.
I am not an expert on hashes, the opposite I would consider my self a beginner but I spend a big amount of time in order to learn how to solve your complicated hash response from the XML parser.
At the end it is not that complicated.
A few things that I noticed on your "example" code:
You are using use File::Slurp; on your sample code. Do you really need it? I was you I would play around with open. But this is only my opinion if you prefer using modules this is another solution. I have modified my answer in a similar way.
Before posting your XML file please please format your XML text. It makes difficult for the rest of us to understand how is split into pieces and what are the data that we want to extract.
A nicely formatted question, always attract more answers from the rest of the monks.
So based on your code and data provided this is a possible solution to your question.
#!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; ## test script to verify the way xml is parsed## ## $xmlfile is set to data of a format that would be expected to be pa +ssed to this if used in a loop ## my $xmlfile = '<?xml version="1.0" encoding="UTF-8"?> <TMSMessage xmlns="http://xmlns.sony.net/d-cinema/tms-api/v1"> <MessageHeader> <Id>-1</Id> <Type>ListPerformances</Type> <Timestamp>1433796462559</Timestamp> <Source>TMS</Source> </MessageHeader> <MessageBody> <ListPerformancesResponse> <EventInfoList> <EventInfo> <EventId>2015060400000157</EventId> <EventTitle>zClosing Shutdown 3D v6 - New</EventTitle> <SplId>2010010100000038</SplId> <SplTitle>zClosing Shutdown 3D v6 - New</SplTitle> <AuditoriumId>15</AuditoriumId> <AuditoriumNo>15</AuditoriumNo> <EventStartTime>2015-06-08T00:30:00-07:00</EventStartTime> <DcpFlg>true</DcpFlg> <KdmFlg>true</KdmFlg> <EventDuration>464</EventDuration> <ShowStartTime>2015-06-08T00:30:00-07:00</ShowStartTime> <ShowDuration>464</ShowDuration> <SpokenLang></SpokenLang> <SubtitleLang></SubtitleLang> <Rating></Rating> <OverlappedEventFlg>false</OverlappedEventFlg> <UncompletedShowFlg>false</UncompletedShowFlg> <HavingShowFlg>true</HavingShowFlg> <EventBodyColor>696969</EventBodyColor> <ImportFlg>false</ImportFlg> <OverlappedNum>1</OverlappedNum> <HeightPos>0</HeightPos> <WaitGPIFlg>false</WaitGPIFlg> <EventEndTime>2015-06-08T00:37:44-07:00</EventEndTime> <ThreeDimension>true</ThreeDimension> <EventStatus>0</EventStatus> <ImportedShowId></ImportedShowId> <ImportedAnalogFlg>false</ImportedAnalogFlg> <EventRating></EventRating> <RatingFlg>true</RatingFlg> <PreshowPackList></PreshowPackList> </EventInfo> <!-- End of event info 1, start of event info 2 --> <EventInfo> <EventId>2015060400000164</EventId> <EventTitle>zMorning Startup 3D v3</EventTitle> <SplId>2011061100000013</SplId> <SplTitle>zMorning Startup 3D v3</SplTitle> <AuditoriumId>15</AuditoriumId> <AuditoriumNo>15</AuditoriumNo> <EventStartTime>2015-06-08T12:10:00-07:00</EventStartTime> <DcpFlg>true</DcpFlg> <KdmFlg>true</KdmFlg> <EventDuration>10</EventDuration> <ShowStartTime>2015-06-08T12:10:00-07:00</ShowStartTime> <ShowDuration>10</ShowDuration> <SpokenLang></SpokenLang> <SubtitleLang></SubtitleLang> <Rating></Rating> <OverlappedEventFlg>false</OverlappedEventFlg> <UncompletedShowFlg>false</UncompletedShowFlg> <HavingShowFlg>true</HavingShowFlg> <EventBodyColor>696969</EventBodyColor> <ImportFlg>false</ImportFlg> <OverlappedNum>1</OverlappedNum> <HeightPos>0</HeightPos> <WaitGPIFlg>false</WaitGPIFlg> <EventEndTime>2015-06-08T12:10:10-07:00</EventEndTime> <ThreeDimension>true</ThreeDimension> <EventStatus>0</EventStatus> <ImportedShowId></ImportedShowId> <ImportedAnalogFlg>false</ImportedAnalogFlg> <EventRating></EventRating> <RatingFlg>true</RatingFlg> <PreshowPackList></PreshowPackList> </EventInfo> <!-- End of event info 2, start of event info 3 --> <EventInfo> <EventId>2015060200000562</EventId> <EventTitle>* Movie1 3D-AV</EventTitle> <SplId>2015060800000048</SplId> <SplTitle>w23_3DP1_Sanandreas_SCCAP_0421pre_150605_02222_TMS_</SplTitl +e> <AuditoriumId>15</AuditoriumId> <AuditoriumNo>15</AuditoriumNo> <EventStartTime>2015-06-08T12:55:00-07:00</EventStartTime> <DcpFlg>true</DcpFlg> <KdmFlg>true</KdmFlg> <EventDuration>8195</EventDuration> <ShowStartTime>2015-06-08T12:29:18-07:00</ShowStartTime> <ShowDuration>9737</ShowDuration> <SpokenLang>en,en,en,en,en,en,en,en,en,en</SpokenLang> <SubtitleLang></SubtitleLang> <Rating>US-G US-G US-G US-G US-G US-G US-G US-G + US-G US-G </Rating> <OverlappedEventFlg>false</OverlappedEventFlg> <UncompletedShowFlg>false</UncompletedShowFlg> <HavingShowFlg>true</HavingShowFlg> <EventBodyColor>696969</EventBodyColor> <ImportFlg>true</ImportFlg> <OverlappedNum>1</OverlappedNum> <HeightPos>0</HeightPos> <WaitGPIFlg>false</WaitGPIFlg> <EventEndTime>2015-06-08T15:11:35-07:00</EventEndTime> <ThreeDimension>true</ThreeDimension> <EventStatus>0</EventStatus> <ImportedShowId>00343929</ImportedShowId> <ImportedAnalogFlg>false</ImportedAnalogFlg> <EventRating>US-13</EventRating> <RatingFlg>true</RatingFlg> <PreshowPackList> <PreshowPack> <PackId>b863a576-d8a3-4f5d-92a7-b66f876f6d7c</PackId> <FrameName>Preshow</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> <PreshowPack> <NoAssign>true</NoAssign> <FrameName>3D_Advertisement</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> <PreshowPack> <PackId>a55164d0-faa7-4c7c-a688-ed36011add95</PackId> <FrameName>Postshow</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> </PreshowPackList> </EventInfo> <!-- End of event info 3, start of event info 4 --> <EventInfo><EventId>2015060200000563</EventId> <EventTitle>* Movie1 3D-AV</EventTitle> <SplId>2015060600000017</SplId> <SplTitle>w23_3DP1_Sanandreas_SCCAP_0421pre_150605_02062_TMS_</SplTitl +e> <AuditoriumId>15</AuditoriumId> <AuditoriumNo>15</AuditoriumNo> <EventStartTime>2015-06-08T16:05:00-07:00</EventStartTime> <DcpFlg>true</DcpFlg> <KdmFlg>true</KdmFlg> <EventDuration>8195</EventDuration> <ShowStartTime>2015-06-08T15:42:13-07:00</ShowStartTime> <ShowDuration>9562</ShowDuration> <SpokenLang>en,en,en,en,en,en,en,en,en,en</SpokenLang> <SubtitleLang></SubtitleLang> <Rating>US-G US-G US-G US-G US-G US-G US-G US-G + US-G US-G </Rating> <OverlappedEventFlg>false</OverlappedEventFlg> <UncompletedShowFlg>false</UncompletedShowFlg> <HavingShowFlg>true</HavingShowFlg> <EventBodyColor>FFFFFF</EventBodyColor> <ImportFlg>true</ImportFlg> <OverlappedNum>1</OverlappedNum> <HeightPos>0</HeightPos> <WaitGPIFlg>false</WaitGPIFlg> <EventEndTime>2015-06-08T18:21:35-07:00</EventEndTime> <ThreeDimension>true</ThreeDimension> <EventStatus>0</EventStatus> <ImportedShowId>00343929</ImportedShowId> <ImportedAnalogFlg>false</ImportedAnalogFlg> <EventRating>US-13</EventRating> <RatingFlg>true</RatingFlg> <PreshowPackList> <PreshowPack> <PackId>760eb073-81f8-45cb-8553-484c5cecb740</PackId> <FrameName>Preshow</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> <PreshowPack> <NoAssign>true</NoAssign> <FrameName>3D_Advertisement</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> <PreshowPack> <PackId>a55164d0-faa7-4c7c-a688-ed36011add95</PackId> <FrameName>Postshow</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> </PreshowPackList> </EventInfo> </EventInfoList> </ListPerformancesResponse> </MessageBody> </TMSMessage>'; my $performancelist = XMLin( $xmlfile, ForceArray => 1, KeyAttr => { EventIn => 'EventId' } #ventID is a unique value that I want to use as a k +ey value ## ); #print Dumper $performancelist; my $filename = 'mydump.log'; open(my $fh, '>', $filename) or die "Could not open file '$filename' $!"; print $fh Dumper $performancelist; close $fh or die "Could not close file '$filename' $!"; foreach my $keys (keys $performancelist) { #print "\$keys: " . $keys . "\n"; foreach my $listPerformancesResponse ( keys $performancelist->{Mes +sageBody}[0] ) { #print $performancelist->{MessageBody}[0]->{$listPerformancesRespo +nse}[0] . "\n"; foreach my $eventInfoList (keys $performancelist->{MessageBody}[0] +->{$listPerformancesResponse}[0]) { # print Dumper $eventInfoList; foreach my $eventInfo (keys $performancelist->{MessageBody}[0] +->{$listPerformancesResponse}[0]->{$eventInfoList}[0]){ #print "\$eventInfo: " . $eventInfo . "\n"; foreach my $outputKeys (keys $performancelist->{MessageBody}[0 +]->{$listPerformancesResponse}[0]->{$eventInfoList}[0]->{$eventInfo}[ +0]){ print Dumper $outputKeys; } } } } } __DATA__ $VAR1 = 'ShowStartTime'; $VAR1 = 'RatingFlg'; $VAR1 = 'ImportedShowId'; $VAR1 = 'HeightPos'; $VAR1 = 'OverlappedNum'; $VAR1 = 'EventStatus'; $VAR1 = 'PreshowPackList'; $VAR1 = 'Rating'; $VAR1 = 'DcpFlg'; $VAR1 = 'SubtitleLang'; $VAR1 = 'HavingShowFlg'; $VAR1 = 'ThreeDimension'; $VAR1 = 'WaitGPIFlg'; $VAR1 = 'UncompletedShowFlg'; $VAR1 = 'EventTitle'; $VAR1 = 'ImportFlg'; $VAR1 = 'EventId'; $VAR1 = 'SplId'; $VAR1 = 'AuditoriumNo'; $VAR1 = 'EventRating'; $VAR1 = 'EventDuration'; $VAR1 = 'SplTitle'; $VAR1 = 'EventStartTime'; $VAR1 = 'OverlappedEventFlg'; $VAR1 = 'AuditoriumId'; $VAR1 = 'KdmFlg'; $VAR1 = 'ImportedAnalogFlg'; $VAR1 = 'EventBodyColor'; $VAR1 = 'ShowDuration'; $VAR1 = 'EventEndTime'; $VAR1 = 'SpokenLang'; $VAR1 = 'ShowStartTime'; $VAR1 = 'RatingFlg'; $VAR1 = 'ImportedShowId'; $VAR1 = 'HeightPos'; $VAR1 = 'OverlappedNum'; $VAR1 = 'EventStatus'; $VAR1 = 'PreshowPackList'; $VAR1 = 'Rating'; $VAR1 = 'DcpFlg'; $VAR1 = 'SubtitleLang'; $VAR1 = 'HavingShowFlg'; $VAR1 = 'ThreeDimension'; $VAR1 = 'WaitGPIFlg'; $VAR1 = 'UncompletedShowFlg'; $VAR1 = 'EventTitle'; $VAR1 = 'ImportFlg'; $VAR1 = 'EventId'; $VAR1 = 'SplId'; $VAR1 = 'AuditoriumNo'; $VAR1 = 'EventRating'; $VAR1 = 'EventDuration'; $VAR1 = 'SplTitle'; $VAR1 = 'EventStartTime'; $VAR1 = 'OverlappedEventFlg'; $VAR1 = 'AuditoriumId'; $VAR1 = 'KdmFlg'; $VAR1 = 'ImportedAnalogFlg'; $VAR1 = 'EventBodyColor'; $VAR1 = 'ShowDuration'; $VAR1 = 'EventEndTime'; $VAR1 = 'SpokenLang'; $VAR1 = 'ShowStartTime'; $VAR1 = 'RatingFlg'; $VAR1 = 'ImportedShowId'; $VAR1 = 'HeightPos'; $VAR1 = 'OverlappedNum'; $VAR1 = 'EventStatus'; $VAR1 = 'PreshowPackList'; $VAR1 = 'Rating'; $VAR1 = 'DcpFlg'; $VAR1 = 'SubtitleLang'; $VAR1 = 'HavingShowFlg'; $VAR1 = 'ThreeDimension'; $VAR1 = 'WaitGPIFlg'; $VAR1 = 'UncompletedShowFlg'; $VAR1 = 'EventTitle'; $VAR1 = 'ImportFlg'; $VAR1 = 'EventId'; $VAR1 = 'SplId'; $VAR1 = 'AuditoriumNo'; $VAR1 = 'EventRating'; $VAR1 = 'EventDuration'; $VAR1 = 'SplTitle'; $VAR1 = 'EventStartTime'; $VAR1 = 'OverlappedEventFlg'; $VAR1 = 'AuditoriumId'; $VAR1 = 'KdmFlg'; $VAR1 = 'ImportedAnalogFlg'; $VAR1 = 'EventBodyColor'; $VAR1 = 'ShowDuration'; $VAR1 = 'EventEndTime'; $VAR1 = 'SpokenLang';
Update: I do not know if you still follow your post, but I was thinking about it over the last days so it came into my mind an alternative solution. Why you do not extract the data you want from the file that you write?
Sample of code and output is provided under:
#!/usr/bin/perl use strict; use warnings; use XML::Simple; use Data::Dumper; use List::MoreUtils qw( each_array ); ## test script to verify the way xml is parsed## ## $xmlfile is set to data of a format that would be expected to be pa +ssed to this if used in a loop ## my $xmlfile = '<?xml version="1.0" encoding="UTF-8"?> <TMSMessage xmlns="http://xmlns.sony.net/d-cinema/tms-api/v1"> <MessageHeader> <Id>-1</Id> <Type>ListPerformances</Type> <Timestamp>1433796462559</Timestamp> <Source>TMS</Source> </MessageHeader> <MessageBody> <ListPerformancesResponse> <EventInfoList> <EventInfo> <EventId>2015060400000157</EventId> <EventTitle>zClosing Shutdown 3D v6 - New</EventTitle> <SplId>2010010100000038</SplId> <SplTitle>zClosing Shutdown 3D v6 - New</SplTitle> <AuditoriumId>15</AuditoriumId> <AuditoriumNo>15</AuditoriumNo> <EventStartTime>2015-06-08T00:30:00-07:00</EventStartTime> <DcpFlg>true</DcpFlg> <KdmFlg>true</KdmFlg> <EventDuration>464</EventDuration> <ShowStartTime>2015-06-08T00:30:00-07:00</ShowStartTime> <ShowDuration>464</ShowDuration> <SpokenLang></SpokenLang> <SubtitleLang></SubtitleLang> <Rating></Rating> <OverlappedEventFlg>false</OverlappedEventFlg> <UncompletedShowFlg>false</UncompletedShowFlg> <HavingShowFlg>true</HavingShowFlg> <EventBodyColor>696969</EventBodyColor> <ImportFlg>false</ImportFlg> <OverlappedNum>1</OverlappedNum> <HeightPos>0</HeightPos> <WaitGPIFlg>false</WaitGPIFlg> <EventEndTime>2015-06-08T00:37:44-07:00</EventEndTime> <ThreeDimension>true</ThreeDimension> <EventStatus>0</EventStatus> <ImportedShowId></ImportedShowId> <ImportedAnalogFlg>false</ImportedAnalogFlg> <EventRating></EventRating> <RatingFlg>true</RatingFlg> <PreshowPackList></PreshowPackList> </EventInfo> <!-- End of event info 1, start of event info 2 --> <EventInfo> <EventId>2015060400000164</EventId> <EventTitle>zMorning Startup 3D v3</EventTitle> <SplId>2011061100000013</SplId> <SplTitle>zMornnning Startup 3D v3</SplTitle> <AuditoriumId>15</AuditoriumId> <AuditoriumNo>15</AuditoriumNo> <EventStartTime>2015-06-08T12:10:00-07:00</EventStartTime> <DcpFlg>true</DcpFlg> <KdmFlg>true</KdmFlg> <EventDuration>10</EventDuration> <ShowStartTime>2015-06-08T12:10:00-07:00</ShowStartTime> <ShowDuration>10</ShowDuration> <SpokenLang></SpokenLang> <SubtitleLang></SubtitleLang> <Rating></Rating> <OverlappedEventFlg>false</OverlappedEventFlg> <UncompletedShowFlg>false</UncompletedShowFlg> <HavingShowFlg>true</HavingShowFlg> <EventBodyColor>696969</EventBodyColor> <ImportFlg>false</ImportFlg> <OverlappedNum>1</OverlappedNum> <HeightPos>0</HeightPos> <WaitGPIFlg>false</WaitGPIFlg> <EventEndTime>2015-06-08T12:10:10-07:00</EventEndTime> <ThreeDimension>true</ThreeDimension> <EventStatus>0</EventStatus> <ImportedShowId></ImportedShowId> <ImportedAnalogFlg>false</ImportedAnalogFlg> <EventRating></EventRating> <RatingFlg>true</RatingFlg> <PreshowPackList></PreshowPackList> </EventInfo> <!-- End of event info 2, start of event info 3 --> <EventInfo> <EventId>2015060200000562</EventId> <EventTitle>* Movie1 3D-AV</EventTitle> <SplId>2015060800000048</SplId> <SplTitle>w23_3DP1_Sanandreas_SCCAP_0421pre_150605_02222_TMS_</SplTitl +e> <AuditoriumId>15</AuditoriumId> <AuditoriumNo>15</AuditoriumNo> <EventStartTime>2015-06-08T12:55:00-07:00</EventStartTime> <DcpFlg>true</DcpFlg> <KdmFlg>true</KdmFlg> <EventDuration>8195</EventDuration> <ShowStartTime>2015-06-08T12:29:18-07:00</ShowStartTime> <ShowDuration>9737</ShowDuration> <SpokenLang>en,en,en,en,en,en,en,en,en,en</SpokenLang> <SubtitleLang></SubtitleLang> <Rating>US-G US-G US-G US-G US-G US-G US-G US-G + US-G US-G </Rating> <OverlappedEventFlg>false</OverlappedEventFlg> <UncompletedShowFlg>false</UncompletedShowFlg> <HavingShowFlg>true</HavingShowFlg> <EventBodyColor>696969</EventBodyColor> <ImportFlg>true</ImportFlg> <OverlappedNum>1</OverlappedNum> <HeightPos>0</HeightPos> <WaitGPIFlg>false</WaitGPIFlg> <EventEndTime>2015-06-08T15:11:35-07:00</EventEndTime> <ThreeDimension>true</ThreeDimension> <EventStatus>0</EventStatus> <ImportedShowId>00343929</ImportedShowId> <ImportedAnalogFlg>false</ImportedAnalogFlg> <EventRating>US-13</EventRating> <RatingFlg>true</RatingFlg> <PreshowPackList> <PreshowPack> <PackId>b863a576-d8a3-4f5d-92a7-b66f876f6d7c</PackId> <FrameName>Preshow</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> <PreshowPack> <NoAssign>true</NoAssign> <FrameName>3D_Advertisement</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> <PreshowPack> <PackId>a55164d0-faa7-4c7c-a688-ed36011add95</PackId> <FrameName>Postshow</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> </PreshowPackList> </EventInfo> <!-- End of event info 3, start of event info 4 --> <EventInfo><EventId>2015060200000563</EventId> <EventTitle>* Movie1 3D-AV</EventTitle> <SplId>2015060600000017</SplId> <SplTitle>w23_3DP1_Sanandreas_SCCAP_0421pre_150605_02062_TMS_</SplTitl +e> <AuditoriumId>15</AuditoriumId> <AuditoriumNo>15</AuditoriumNo> <EventStartTime>2015-06-08T16:05:00-07:00</EventStartTime> <DcpFlg>true</DcpFlg> <KdmFlg>true</KdmFlg> <EventDuration>8195</EventDuration> <ShowStartTime>2015-06-08T15:42:13-07:00</ShowStartTime> <ShowDuration>9562</ShowDuration> <SpokenLang>en,en,en,en,en,en,en,en,en,en</SpokenLang> <SubtitleLang></SubtitleLang> <Rating>US-G US-G US-G US-G US-G US-G US-G US-G + US-G US-G </Rating> <OverlappedEventFlg>false</OverlappedEventFlg> <UncompletedShowFlg>false</UncompletedShowFlg> <HavingShowFlg>true</HavingShowFlg> <EventBodyColor>FFFFFF</EventBodyColor> <ImportFlg>true</ImportFlg> <OverlappedNum>1</OverlappedNum> <HeightPos>0</HeightPos> <WaitGPIFlg>false</WaitGPIFlg> <EventEndTime>2015-06-08T18:21:35-07:00</EventEndTime> <ThreeDimension>true</ThreeDimension> <EventStatus>0</EventStatus> <ImportedShowId>00343929</ImportedShowId> <ImportedAnalogFlg>false</ImportedAnalogFlg> <EventRating>US-13</EventRating> <RatingFlg>true</RatingFlg> <PreshowPackList> <PreshowPack> <PackId>760eb073-81f8-45cb-8553-484c5cecb740</PackId> <FrameName>Preshow</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> <PreshowPack> <NoAssign>true</NoAssign> <FrameName>3D_Advertisement</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> <PreshowPack> <PackId>a55164d0-faa7-4c7c-a688-ed36011add95</PackId> <FrameName>Postshow</FrameName> <FrameNumber>1</FrameNumber> </PreshowPack> </PreshowPackList> </EventInfo> </EventInfoList> </ListPerformancesResponse> </MessageBody> </TMSMessage>'; my $performancelist = XMLin( $xmlfile, ForceArray => 1, KeyAttr => { EventIn => 'EventId' } #ventID is a unique value that I want to use as a k +ey value ## ); #print Dumper $performancelist; my $filename = 'mydump.log'; open(my $fhWrite, '>', $filename) or die "Could not open file '$filename' $!"; print $fhWrite Dumper $performancelist; close $fhWrite or die "Could not close file '$filename' $!"; my (@frameNamelinesContainData,@packIdlinesContainData); open(my $fhRead, '<', $filename) or die "Could not open file '$filename' $!"; my @dataArray = <$fhRead>; my $lineNumber = 0; foreach my $line (@dataArray) { $lineNumber++; if ($line =~ /FrameName/) { push @frameNamelinesContainData , $lineNumber; } elsif ($line =~ /PackId/) { push @packIdlinesContainData , $lineNumber; } } close $fhRead or die "Could not close file '$filename' $!"; splice @frameNamelinesContainData, 1, 1; splice @frameNamelinesContainData, 3, 1; my %output; my $ea = each_array( @frameNamelinesContainData, @packIdlinesContainDa +ta ); while ( my( $a, $b ) = $ea->() ) { $dataArray[$a] =~ s/^\s+|\s+$//g; $dataArray[$b] =~ s/^\s+|\s+$//g; $output{'FrameName'}{$dataArray[$b]} = $dataArray[$a]; } print Dumper \%output; __DATA__ $VAR1 = { 'FrameName' => { '\'b863a576-d8a3-4f5d-92a7-b66f876f6d7c\'' +=> '\'Preshow\'', '\'a55164d0-faa7-4c7c-a688-ed36011add95\'' +=> '\'Postshow\'', '\'760eb073-81f8-45cb-8553-484c5cecb740\'' +=> '\'Preshow\'' } };
Hope this helps.
In reply to Re: XML Parsing Problems
by thanos1983
in thread XML Parsing Problems
by taralon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |