title: Cannot access all XML elements PERL
body: <p>I have a simple Perl script which can parse a downloaded XML file from a server. The only problem is that the array I have made only seems to store the first set of tags.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>sub test_button_func() {
  
  $ua-&gt;cookie_jar($cookie_jar);
  # Now make your request
  
  my $server_endpoint = "server_url_link";
  $server_endpoint =~ s/\%id\%/$user/g;
  
  # set custom HTTP request header fields
  my $req = HTTP::Request-&gt;new(GET =&gt; $server_endpoint);
  $req-&gt;header('content-type' =&gt; 'application/json');
  
  my $parser = shift;
  my $resp = $ua-&gt;request($req);
  
  if ($resp-&gt;is_success) {
  
      # XML response received from Jazz API.
      my $message = $resp-&gt;decoded_content;
  
      # Parse the XML downloaded here:
      # create object
      my $xml = new XML::Simple;
  
      # Read XML file
      my @data = $xml-&gt;XMLin($message);
      my $arraySize = scalar (@data);
  
      # Print out the data we need
      for (my $num = 0; $num &lt;= ($arraySize - 1); $num++) {
          print @data[0]-&gt;{'oslc_disc:entry'}[$num]{'oslc_disc:ServiceProvider'}{'dc:title'};
          print "\n";
      }
  }
  
  else {
      print "HTTP GET error code: ", $resp-&gt;code, "\n";
      print "HTTP GET error message: ", $resp-&gt;message, "\n";
      print $resp-&gt;decoded_content;
  }
  }
  </code></pre>
  
  <p>The XML I am try to parse is this:</p>
  
  <pre><code>&lt;oslc_disc:entry&gt;
  
  &lt;oslc_disc:ServiceProvider&gt;
  
      &lt;dc:title&gt;URL MAIN TITLE&lt;/dc:title&gt;
      &lt;oslc_disc:details rdf:resource="URL LINK"/&gt;
      &lt;oslc_disc:services rdf:resource="URL LINK"/&gt;
      &lt;jfs_proc:consumerRegistry rdf:resource="URL LINK"/&gt;
  
  &lt;/oslc_disc:ServiceProvider&gt;
  
  &lt;/oslc_disc:entry&gt;
  </code></pre>
  
  <p>So my point is that I can parse the very first "oslc_disc" entry. But there is much more than one of those in the XML file. How do I parse the rest?</p>