fun with hashes!

Uri Guttman <[email protected]> Fri, 23 Nov 2007 13:12:37 -0500
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
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  ------  [email protected]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org