Training, Open Source computer languages

PerlPHPPythonMySQLhttpd / TomcatTclRubyJavaC and C++LinuxCSS

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact

Tips and short articles on this subject
Stable sorting - Tcl, Perl and others
Perl - a list or a hash?
-> , >= and => in Perl
(Perl) Callbacks - what are they?
What is a callback?
Conventional restraints removed
Well House Consultants
You are on the site of Well House Consultants who provide Open Source Training Courses and business hotel accommodation. You are welcome to browse and use our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Hashes - Perl module P211
A hash is a collection of scalars, but each element can be named rather than numbered as it would be in a list. This makes it similar to a database table in many ways and leads to some truly remarkable capabilities.

This topic is presented on public courses Perl Programming, Perl bootcamp

Examples from our training material
acl   Sample answer - web_c2, page 152
bankout   initialising a hash
cbdemo   How sort callbacks work
env2   ENV module to import variables as globals
envrep   use of %ENV
h1   Setting up, adding to, changing a hash (associative array)
hash1.pl   setting up and using a hash
nip2   set up and loop though a hash in various ways
nip3   the danger of jumping out of an each loop
nip4   Sorting the keys of a hash
niports   hash - manipulation
peeps.pl   Set up a hash of people
so2   Sort using your own sort subroutine
so4   sort using a more complex routine
so5   sorting with a comparison block
sorter   Demonstration of default dort order
stdhash   keys must be unique - example illustrates the problem
stdhash3   Hash keys must be unique - so make up a new keu
stdhash4   Keys must be unique - design new keys, add accessor loops to find multiple keys
sthash2   Keys must be unique - solution 1 - Append all possible values
ukports   fill and look up a hash
web_count   Sample answer - web access counter question 1
webc2   Sample answer - 2nd question
Opentalk forum discussions related to this topic
Summation of file size according to user
sorting the spread sheet
Sorting a list of hashes
Sorting Data
Running another app with a changed environment
Removing duplicate lines with a regular expression
Reformatting question
Is this a hash in an SQL insert statement
Another large text file example
sorting program for golf scores
Pictures
Everyone's concentrating on the exercise
Background information
Some modules are available for download as a sample of our material or under an Open Training Notes License for free download from http://www.training-notes.co.uk.
Topics covered in this module
What is a hash?
Setting up a hash.
Keys and values.
Accessing a hash.
Processing every element.
Sorting.
cmp and operators.
Programming techniques for hashes.
Deleting hash elements.
Special hashes.
The environment.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses at our training centre in Melksham, Wiltshire, England. It's surprisingly cost effective to come on our public courses - even if you live in a different country or continent to us.

We have a technical library of over 600 books on the subjects on which we teach. These books are available for reference at our training centre. Also available is the Opentalk Forum for discussion of technical questions.



WELL HOUSE CONSULTANTS LTD.: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 0800 043 8225 or 01225 708225 • FAX: 0845 8382 405 or 01225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho