Thanks for your quick reply, sorry for lack of information. I have added the full code below. I am trying to get the values of author into an array. Unfortuantely  my @array = map{$_->textContent} $authors->findnodes('./authors/author'); does not do this. Hopefuly this makes more sense

use CGI qw(-utf-8 :all *table); use LWP::Simple qw(get); use URI; use XML::LibXML; use Data::Dumper; use utf8; binmode(STDOUT, ":encoding(utf-8)"); my $parser = XML::LibXML->new(); $author = param('query'); $maxHits = param('maxHits'); my $url = URI->new("http://www.dblp.org/search/api/?"); my($q,$h,$c,$f,$format) = ($author,$maxHits,"4","0","xml"); $url->query_form( 'q' => $q, 'h' => $h, 'c' => $c, 'f' => $f, 'format' => $format, ); print header(-charset=>'utf-8'), "\n", start_html({-title=>'DBLP Search', -author=>'<>'}), "\n"; if (param('submit')) { my $xml= get($url); my $doc = $parser->parse_string( $xml); print h1("Authors"), "\n"; foreach my $authors ($doc->findnodes('/result/hits/hit/info')) { print $_->textContent, "\n" for $authors->findnodes('./authors +/author'); my @array = map{$_->textContent} $authors->findnodes('./author +s/author'); } } print h1("DBLP Query"), "\n"; print start_form({-method=>"POST" -action=>"http://cgi.csc.liv.ac.uk/cgi-bin/cgiwrap/u6ed/stat.pl"}) +; print label("query: "); print textfield({-name=>'query', -size=>200}), "\n"; print label("maxHits: "); print textfield({-name=>'maxHits', -size=>200}), "\n"; print br(), "\n"; print submit({-name=>'submit', -value=>'Submit'}), "\n"; print end_form, end_html

XML file:

<?xml version="1.0" encoding="UTF-8"?> <result> <query id="192448">Aderghal*</query> <status code="200">OK</status> <time unit="msecs">1.15</time> <completions total="1" computed="1" sent="1"> <c sc="5" dc="5" oc="5" id="19115731">aderghal</c> </completions> <hits total="5" computed="5" sent="5" first="0"> <hit score="1" id="80402"> <info><authors><author>Karim Aderghal</author><author>Alexander Khvost +ikov</author><author>Andrei Krylov</author><author>Jenny Benois-Pinea +u</author><author>Karim Afdel</author><author>Gwenaelle Catheline</au +thor></authors><title>Classification of Alzheimer Disease on Imaging +Modalities with Deep CNNs Using Cross-Modal Transfer Learning.</title +><venue>CBMS</venue><pages>345-350</pages><year>2018</year><type>Conf +erence and Workshop Papers</type><key>conf/cbms/AderghalKKBAC18</key> +<doi>10.1109/CBMS.2018.00067</doi><ee>https://doi.org/10.1109/CBMS.20 +18.00067</ee><url>https://dblp.org/rec/conf/cbms/AderghalKKBAC18</url +></info> <url>URL#80402</url> </hit> </hits> </result>

In reply to Re^2: Return values of tags which have the same name, in an array by Anonymous Monk
in thread Return values of tags which have the same name, in an array by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.