Here is a small piece of code that i couldn't understand. and i get an error as indicated in the comment below. can anyone please explain me the reason for this and what that particular line is doing.

thanks in advance.

foreach $item (@results) { @line=split/,/, $item; $seen{$line[1]}="0"; #$seen{$item}=0; #print "LINE 1 $line[1]\n"; } foreach $item (@results) { @line=split/,/, $item; if ($line[0] =~ /1|6|7|8|9|5/) { &integrate; sub integrate { %matching=(); if ($line[0]=~/6|7|8|/) { $overlapc=$line[1]; foreach $itemi (@eresults) { @linei=split/,/, $itemi; if ($linei[1] eq $line[1]) { @matchone=split/ /, $linei[2]; $lengthandn=$line[4].',', $line[5]; ##error here--- Useless us +e of array element in void context--can u please tell me what this li +ne does. $matching{$matchone[0]}="$lengthandn"; $matching{$matchone[1]}="$lengthandn"; #$seenclone{$matchclone[1]}="1"; #print "678 line 1 $line[1] Length $lengthandn matchclone $matchclone +[1] m0 $matchclone[0]\n"; } }

20040527 Edit by castaway: Changed title from 'newbie- help with a piece of code'


In reply to Help resolve Useless use of array element in void context warning. by talk2kvj

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.