2009

Perl Modules for Constructing Iterators

The 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 recurrence 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.

This work was done by Curt Tilmes of Goddard Space Flight Center. For further information, contact the Goddard Innovative Partnerships Office at (301) 286-5810. GSC-15560-1/1-1/2-1

White Papers

Stencil-less Jet Printing for PCB Assembly
Sponsored by Imagineering
Critical Techniques for High-Speed A/D Converters in Real-Time Systems
Sponsored by Pentek
Symbolic Techniques for Model Code Optimization: FMI Applications
Sponsored by Maplesoft
The Best Springs You Haven't Tried Yet
Sponsored by Rotor Clip
Use Metal Bellows To Replace Springs
Sponsored by Servometer
Reducing Development Cycles for 3U VPX Systems
Sponsored by Curtiss-Wright Controls Embedded Computing

White Papers Sponsored By:

The U.S. Government does not endorse any commercial product, process, or activity identified on this web site.