You can argue until the cows come home what the appropriate Perl analogy for a linked list is. But there is no question about whether they are often used in the two use cases I presented, and about whether Perl arrays are appropriate as a replacement for that use case.

I don't know what you meant by saying that Perl hashes are implemented via C pointer arrays. They certainly are not just internally an array. But as is normal for implementing a hash table, Perl hashes are implemented using both a C-style array for the lookup of the hash bucket from the hash value, and linked lists for the contents of each hash bucket. For the details you can look in perlguts, and for the really gory details read hv.h and hv.c in the Perl source code.

To answer your rhetorical question about how long it takes to write Perl, multiple studies across multiple language, backed up by anecdotal experience among Perl programmers that I know, says that X lines of Perl takes roughly as long to develop as X lines of other mainstream programming languages. Furthermore comprehensibility is more an effect of the programmer rather than the language. Though if you wish to write incomprehensible code, as Larry Wall says, In accordance with UNIX philosophy, Perl gives you enough rope to hang yourself.


In reply to Re^5: Perl vs C by tilly
in thread Perl vs C by santhosh_89

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.