Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8641011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:25:04+00:00 2026-06-12T11:25:04+00:00

I have a program that parses some XML using XML::Simple . It appears at

  • 0

I have a program that parses some XML using XML::Simple. It appears at some point the XML has redundant entries in it that get serialized, but I can’t for the life of me figure out how to get that data back as a simple string. There is a subset of this XML that appears that it is being put into an array by XML::Simple. The pertinent subsection is as follows when running a Dumper($data) where data is my parsed XML.

Audio = [
      {
        'AudioIndex' => {
                        'StartByteOffset' => '32768',
                        'DataSize' => '3071872'
                      },
        'SamplingRate' => '48000',
        'BitsPerSample' => '16',
        'AudioFormat' => 'MXF'
      },
      {
        'AudioIndex' => {
                        'StartByteOffset' => '32768',
                        'DataSize' => '3071872'
                      },
        'SamplingRate' => '48000',
        'BitsPerSample' => '16',
        'AudioFormat' => 'MXF'
      },
      {
        'AudioIndex' => {
                        'StartByteOffset' => '32768',
                        'DataSize' => '3071872'
                      },
        'SamplingRate' => '48000',
        'BitsPerSample' => '16',
        'AudioFormat' => 'MXF'
      },
      {
        'AudioIndex' => {
                        'StartByteOffset' => '32768',
                        'DataSize' => '3071872'
                      },
        'SamplingRate' => '48000',
        'BitsPerSample' => '16',
        'AudioFormat' => 'MXF'
      }
    ];

I pass a small subset of my XML parsed output to a variable like so:


my @audiostuff = $data->{ClipContent}->{EssenceList}->{Audio};

When I output the dump of this, i get the following

$VAR1 = [
      {
        'AudioIndex' => {
                        'StartByteOffset' => '32768',
                        'DataSize' => '3071872'
                      },
        'SamplingRate' => '48000',
        'BitsPerSample' => '16',
        'AudioFormat' => 'MXF'
      },
      {
        'AudioIndex' => {
                        'StartByteOffset' => '32768',
                        'DataSize' => '3071872'
                      },
        'SamplingRate' => '48000',
        'BitsPerSample' => '16',
        'AudioFormat' => 'MXF'
      },
      {
        'AudioIndex' => {
                        'StartByteOffset' => '32768',
                        'DataSize' => '3071872'
                      },
        'SamplingRate' => '48000',
        'BitsPerSample' => '16',
        'AudioFormat' => 'MXF'
      },
      {
        'AudioIndex' => {
                        'StartByteOffset' => '32768',
                        'DataSize' => '3071872'
                      },
        'SamplingRate' => '48000',
        'BitsPerSample' => '16',
        'AudioFormat' => 'MXF'
      }
    ];

So all seems right in the captured array. The array appears to have one element, and inside that one element there are four hashes. This is where I get stuck. I have no idea how to get the information in these hashes back out again. I’ve tried about 40 different things and I’m just banging my head against the wall. I’d love to either just pass the values of each hash into a simple local array (something like @samplingrate for example) where I have all four of these entries in it and can simply reference them by $samplingrate[0], etc.

Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:25:05+00:00Added an answer on June 12, 2026 at 11:25 am

    I believe you mean to be dereferencing the array, like so:

    my @audiostuff = @{ $data->{ClipContent}->{EssenceList}->{Audio} };
    # do stuff with $audiostuff[0], etc.
    

    or just use an arrayref instead

    my $audiostuff = $data->{ClipContent}->{EssenceList}->{Audio};
    # do stuff with $audiostuff->[0], etc.
    

    For some memorizable rules for dealing with references and data structures, see http://perlmonks.org?node=References+quick+reference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, I have an iphone program that has a parser that parses some XML
Well, i have written a simple python program that parses HTML with HTMLParser. Here
We have a program with a main() that parses certain CLPs but does not
I have program that has a variable that should never change. However, somehow, it
I have a program that gets a JSON from the server using getJSON and
I have a program that generates some standard SQL like SELECT * FROM TEST
I have a program that needs to connect to a server to gather some
I have written a little program that parses log files of anywhere between a
I have a Java program that does some String matching. I'm looking for anything
I've been working on a program that parses and interprets some data, but I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.