|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
Prev | Up | Contents | Down | Next
Version 0.72(beta)
Contents
3.1. String operations
3.2. Operations on Arrays
3.3. Operations on Associative Arrays
3.4. Summary
3.5. Homework
Perl supports several types of data structures:
Another way to look into data structures is to analyze their strength and weaknesses
All in all Perl provide a rich set of built-in operation for lists and associative arrays (hashes). It also provides some connections between these two data structures. Here Perl is really one of the top if not the top language in existence. If you task can be structured of information along these lines (text processing) you can immensely benefit from using Perl.
At the same time multidimensional arrays are not natural to Perl and if your task does require them you probably will be in disadvantage and should consider either using references or switch to other language that supports this abstraction better.
Good introduction to Perl variables can be found in
While in many way a very innovative language Perl suffers from some design decisions connected with using separate sets of build-in functions for strings and arrays:
The main problem with Perl that I see is the although it provides a rich set of functions for string and arrays they are not generalized in such a way that similar functions are applicable to both without renaming, although this is entirely possible. So instead of substr functions (that is defined on strings) you need to use splice function for arrays and remember idiosyncrasies of two functions instead of one. Here Larry Wall made a very bad decision, but we can do nothing about it. You will see the problem yourself after you will face the assortment of functions that are available in Perl for arrays and strings. Actually you are forced to use a subset as full assortment is beyond human capacities to master (starving in the food store effect ;-).
Prev | Up | Contents | Down | Next
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Created: November 7 1998; Last modified: September 05, 2009