Skip to content

Perl_hash

Derek Lamb edited this page Sep 19, 2015 · 3 revisions

Perl hash

A Perl hash is a collection of values indexed by keyword with in the Perl language. Normal perl hashes are dynamic structures that are indexed by a hash function of the keyword, so they are very fast to evaluate (constrast IDL structures, which are also dynamic but which use linear search through a collection of keyword/value pairs).

Perl hashes may be tied, meaning that the underlying code inside the Perl interpreter itself is replaced by some other mechanism for accessing some other data by keyword. The FLUX C structures are represented within Perl as tied hashes, so that it is possible to browse/explore/search an entire FLUX simulation entirely from the Perl millieu without recourse to C coding.

Perl hashes may be encapsulated in a scalar via the Perl ref mechanism.