setifempty.pl

Description

Setifempty.pl is a HFPM module that sets given field(s) to a given value if it was not already set to a value (other than the empty string or 0).

Usage

setifempty.pl {field=value} in the pipeline.

Usage Explanation

Items to be set are indicated arguments in the form dest=val. The destination is indicated in the left hand side of arguments. The right hand side is the value to set the destination to.

The assignment only takes place if the destination is not already set.

Examples

setifempty.pl afield=one
sets the field "afield" to "one" if the field "afield" is not set or 0.
setifempty.pl anotherfield=two
sets the field "anotherfield" to "two" if "anotherfield" is not set or 0.

Other Notes

The current version number is 1.0.

This module should work on any platform with a perl version 5 and CGI FPI implementation.

This module can be used more than once in the pipeline.


[HFPM Home] [Please comment]
Copyright © by James Hoagland
www.hoagland.org | webmaster@hoagland.org
14 March 1996