FUNCTION MODULE - function.pm
The function module allows the user write macros which call Perl functions. Its file name is function.pm.

The function module allows macros of the form: macro(arg1, arg2, arg3, ...) to be added to a file. When the macro is found, it will run a function from a Perl module, with arguments arg1, arg2, arg3, ... passed to the function. The function must return a string. The returned string will replace the call to the function in the output. The function can have any number of arguments. If the function has no arguments it should be called with an empty argument list: macro() If the word macro is found in the input file without being followed by a ( it will be ignored.

To use the function module, the user must provide a Perl function which optionally takes in arguments and returns a string. The function can either be one of filepp's internal functions or one of the user's own provided in a Perl module. The function can be added in two ways. The first way is through the function keyword:

#function macro function
    macro is the name of the macro which is used to signify a call to the function in the input file and function is the name of the function to be called.

The second method of adding a function is to call the Perl function:

Function::AddFunction($macro,$function)
    which has the same inputs as the function keyword.

Functions can be removed either through the keyword:

#rmfunction macro
    or through the Perl function

Function::RemoveFunction($macro)