in reply to Perl linked list
As others have said, this entire scenario is very hypothetical. If you want to have “a list of <<whatever>>” in Perl, you don’t have to do it yourself. The Perl interpreter already provides “a list,” as well as hash-tables, as an intrinsic language feature. It also provides a sophisticated memory manager to make your memory calesthenics relatively painless.
Perl’s “references” feature also makes it possible to home-grow your own lists, or trees, or any other data structure you might have just pulled from your college textbook. But, there is a catch. It is easy to create circular references, which defeat the purpose of the built-in memory manager unless you know about, and properly account for, “weakened references.”
Finally, although Perl does offer the facilities needed to “homebrew” your own data structures from scratch, the CPAN library offers a cornucopia of data-structure modules which you can simply grab “off the shelf” and use, without having to write anything at all yourself. Since every one of them will be thoroughly tested (on your system) before they will consent to let themselves be installed, you can use them with confidence.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl linked list
by Anonymous Monk on Apr 01, 2015 at 13:29 UTC |