NASA Logo

NTRS

NTRS - NASA Technical Reports Server

Back to Results
Perl Modules for Constructing IteratorsThe Iterator Perl Module provides a general-purpose framework for constructing iterator objects within Perl, and a standard API for interacting with those objects. Iterators are an object-oriented design pattern where a description of a series of values is used in a constructor. Subsequent queries can request values in that series. These Perl modules build on the standard Iterator framework and provide iterators for some other types of values. Iterator::DateTime constructs iterators from DateTime objects or Date::Parse descriptions and ICal/RFC 2445 style re-currence descriptions. It supports a variety of input parameters, including a start to the sequence, an end to the sequence, an Ical/RFC 2445 recurrence describing the frequency of the values in the series, and a format description that can refine the presentation manner of the DateTime. Iterator::String constructs iterators from string representations. This module is useful in contexts where the API consists of supplying a string and getting back an iterator where the specific iteration desired is opaque to the caller. It is of particular value to the Iterator::Hash module which provides nested iterations. Iterator::Hash constructs iterators from Perl hashes that can include multiple iterators. The constructed iterators will return all the permutations of the iterations of the hash by nested iteration of embedded iterators. A hash simply includes a set of keys mapped to values. It is a very common data structure used throughout Perl programming. The Iterator:: Hash module allows a hash to include strings defining iterators (parsed and dispatched with Iterator::String) that are used to construct an overall series of hash values.
Document ID
20090032094
Acquisition Source
Goddard Space Flight Center
Document Type
Other - NASA Tech Brief
Authors
Tilmes, Curt
(NASA Goddard Space Flight Center Greenbelt, MD, United States)
Date Acquired
August 24, 2013
Publication Date
September 1, 2009
Publication Information
Publication: NASA Tech Briefs, September 2009
Subject Category
Technology Utilization And Surface Transportation
Report/Patent Number
GSC-15560-1/1-1/2-1
Distribution Limits
Public
Copyright
Public Use Permitted.
No Preview Available