Basic HTML version of Foils prepared Sept 20 97

Foil 31 Hashes -- Examples

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


1 One can think of a hash as a simple relational database with two columns and multiple rows labelled by keys
2 For example, hashes can be used to store data defined by MIME or HTTP as these protocols are specified in terms of a set of header statements
  • Content-type: text/plain # corresponds to
  • $mime{Content-type} = "text/plain"; # and so on
3 Similarly this data type can be used to store values read as arguments of a UNIX command as these are either of form
  • -keyname value # or
  • -keyname # just to indicate option set (value = yes or no)

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Sep 21 1997