develooper Front page | perl.fwp | Postings from November 2007

fun with hashes!

Thread Next
From:
Uri Guttman
Date:
November 23, 2007 10:13
Subject:
fun with hashes!
Message ID:
x7tzncomp6.fsf@mail.sysarch.com

too long has this list been quiet. but i have a fun question. i am
writing up slides for an all about hashes class. one goal i have is to
list and explain as many different uses for hashes as reasonably
possible. i have a short list to start with but i am sure the hive mind
of fwp can scrape up a bunch more. each one should have a name and not
overlap too much with any of this list (my initial list should be
obvious to you).

	dispatch table

		call code ref based on a key

	isa
		is a key valid? (not same as in a set). isa usually works on
		fixed sets of keys

		my @foos = qw( axxj djdj whwh ) ;
		my %is_a_foo = map { $_ => 1 } @foos

	mapping/conversion

		short month to long month

	records

		single row from a db or similar

	data structures

		hash refs are the core to most deeper data structures

	sets

		set of active objects in a class. plenty of other examples

	sparse arrays

		saves major space when you have very few entries in a
		very large array.

thanx,

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About