Hi everyone, I am very new to pearl scripting. Actually i am having a doubt I am inserting some values into an array using the push command and i want to retrieve some of this values using the indexes. Is it possible? i.e, I am inserting var1, var2,var3,var4...var100 values into an array @list
push(@list,$var1); push(@list,$var2); push(@list,$var3); . . push(@list,$var100);
Now my question, is it possible to retrieve some of the elements from that array though indexes like list[5],list[10],list[15],list[25]?. I tried it, but in vain..please help me.

In reply to Accesing the array elements via indexes which are inserted into it by push by paddu

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.