You can put any delimiter like '§', '€' or '€£'..., not used.

That's exactly the problem: You have to find an "unused" delimiter. In real-word applications, you can have situations where there is no "unused" delimiter. Any array element may contain any sequence of bytes or characters. Whatever sequence of bytes / characters you could invent, it may also occur as part of an array element.

In the explanation, there are overall 150 elements, so it will be difficult to get 2Gb of array.

Why? 150 elements each allocating 14 MBytes easily break the 2 GByte limit. And yes, 14 MBytes in a single array element are perfectly legal in Perl.

But to have 150 elements in an array is bad ;)

Why? What do you think is the legal upper limit for the number of elements in an array? Heck, even the BASIC of my very first computer back in the 1980s allowed arrays of up to 65535 elements!

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^6: The most efficient way for searching for an element in an array? by afoken
in thread The most efficient way for searching for an element in an array? by Ppeoc

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.