Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
Conventional restraints removed

IT without boundaries So say the coffee mugs where I'm training this week - a company motto that seems very appropriate when I'm teaching about Perl's lists. Most languages allow you to define a whole series of values in a single variable (an array), but if you're writing in C or Java, you're probably used to having to define the number of elements, and the size of each element, ahead of time. Perl is different - with Perl lists you can simply refer to the list for the first time and it will be created, and you can save as many values as you like into it and the list will be extended as need be to handle your request.

I must be fair to C and Java, though. In C, you can use calloc, malloc and realloc to dynamically assign memory if you wish and Java's Vector and ArrayList classes also let you set up a dynamic container in a similar way in that language.

(written 2005-03-09, updated 2006-06-05)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
P208 - Perl - Lists
  [3939] Lots of ways of doing the same thing in Perl - list iteration - (2012-12-03)
  [3906] Taking the lead, not the dog, for a walk. - (2012-10-28)
  [3870] Writing more maintainable Perl - naming fields from your data records - (2012-09-25)
  [3669] Stepping through a list (or an array) in reverse order - (2012-03-23)
  [3548] Dark mornings, dog update, and Python and Lua courses before Christmas - (2011-12-10)
  [3400] $ is atomic and % and @ are molecular - Perl - (2011-08-20)
  [2996] Copying - duplicating data, or just adding a name? Perl and Python compared - (2010-10-12)
  [2833] Fresh Perl Teaching Examples - part 2 of 3 - (2010-06-27)
  [2813] Iterating over a Perl list and changing all items - (2010-06-15)
  [2484] Finding text and what surrounds it - contextual grep - (2009-10-30)
  [2295] The dog is not in trouble - (2009-07-17)
  [2226] Revision / Summary of lists - Perl - (2009-06-10)
  [2067] Perl - lists do so much more than arrays - (2009-03-05)
  [1918] Perl Socket Programming Examples - (2008-12-02)
  [1917] Out of memory during array extend - Perl - (2008-12-02)
  [1828] Perl - map to process every member of a list (array) - (2008-10-09)
  [1703] Perl ... adding to a list - end, middle, start - (2008-07-09)
  [1316] Filtering and altering Perl lists with grep and map - (2007-08-23)
  [1304] Last elements in a Perl or Python list - (2007-08-16)
  [968] Perl - a list or a hash? - (2006-12-06)
  [928] C++ and Perl - why did they do it THAT way? - (2006-11-16)
  [773] Breaking bread - (2006-06-22)
  [762] Huge data files - what happened earlier? - (2006-06-15)
  [622] Queues and barrel rolls in Perl - (2006-02-24)
  [560] The fencepost problem - (2006-01-10)
  [463] Splitting the difference - (2005-10-13)
  [355] Context in Perl - (2005-06-22)
  [230] Course sizes - beware of marketing statistics - (2005-02-27)
  [140] Comparison Chart for Perl programmers - list functions - (2004-12-04)
  [28] Perl for breakfast - (2004-08-25)

P211 - Perl - Hashes
  [3662] Finding all the unique lines in a file, using Python or Perl - (2012-03-20)
  [3451] Why would you want to use a Perl hash? - (2011-09-20)
  [3106] Buckets - (2010-12-26)
  [3072] Finding elements common to many lists / arrays - (2010-11-26)
  [3042] Least Common Ancestor - what is it, and a Least Common Ancestor algorithm implemented in Perl - (2010-11-11)
  [2920] Sorting - naturally, or into a different order - (2010-08-14)
  [2915] Looking up a value by key - associative arrays / Hashes / Dictionaries - (2010-08-11)
  [2836] Perl - the duplicate key problem explained, and solutions offered - (2010-06-28)
  [1856] A few of my favourite things - (2008-10-26)
  [1826] Perl - Subs, Chop v Chomp, => v , - (2008-10-08)
  [1705] Environment variables in Perl / use Env - (2008-07-11)
  [1334] Stable sorting - Tcl, Perl and others - (2007-09-06)
  [930] -> , >= and => in Perl - (2006-11-18)
  [738] (Perl) Callbacks - what are they? - (2006-05-30)
  [386] What is a callback? - (2005-07-22)


Back to
What and why for the epoch
Previous and next
or
Horse's mouth home
Forward to
Dress for training
Some other Articles
Getting your examples, my examples and the data files after your course
new 'Perl on the Web' example
Satisfaction of training
Dress for training
Conventional restraints removed
What and why for the epoch
Difficulties with a trolley
Crossfertilisation, PHP to Python
Tapping in on resources
Preparation for a day's work
4318 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/240_Conv ... moved.html • PAGE BUILT: Thu Sep 18 15:30:25 2014 • BUILD SYSTEM: WomanWithCat