getcount.pl

Description

Getcount.pl is a HFPM module that sets environmental variable "count" to the number stored in a specified file, incrementing that number. This can be used to keep track of the number of accesses to a page.

Usage

getcount.pl [countfile] in the pipeline.

Usage Explanation

The environmental variable "count" is set to the number stored in the countfile, which is then incremented by one.

The countfile to use is specified (in decreasing order of precedence) on the command line, in the field "_countfile", or in a file called "count". If the field "_comment_dir" is set, then it is used as the assumed base directory for the countfile unless the countfile is found without it.

Examples

"getcount.pl /WWW/comments/my_count" on the pipeline
sets the environmental variable "count" to the value in "/WWW/comments/my_count", which is then incremented.
"getcount.pl" on the pipeline and "/usr/web/comments" in the field "_comment_dir"
sets the environmental variable "count" to the value in "/usr/web/comments/count" (unless a file "count" is found in the current directory), which is then incremented.
"getcount.pl" on the pipeline, "counter" in the field "_countfile", and "/local/www/comments" in the field "_comment_dir"
sets the environmental variable "counter" to the value in "/local/www/comments/counter" (unless a file "counter" is found in the current directory), which is then incremented.

Other Notes

The current version number is 1.0.

The is module should work on any Unix machine.

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

See Also

To set an arbitrary field or environmental variable instead of just the "count" environmental variable, use getcount.pl followed by copy.pl.
[HFPM Home] [Please comment]
Copyright © by James Hoagland
www.hoagland.org | webmaster@hoagland.org
28 January 1996