RevBank::Global

Constants and utility functions


Synopsis

use RevBank::Global;

Description

This module unconditionally exports the following symbols into the calling namespace:

Constants

ACCEPT, ABORT, REJECT, NEXT, REDO

Return codes for plugins. See RevBank::Plugins.

They are RevBank::Symbol sentinels, so compare them with ==.

Functions

say

Print with newline, in case your Perl version doesn't already have a say.

call_hooks($hook, @arguments)

See call_hooks in RevBank::Plugins.

parse_amount($amount)

Returns the amount as a RevBank::Amount if it is well formed, undef if it was not. The amount may be a sum or difference of amounts, like 21+21 or 5-0.50. Throws a RevBank::Exception::RejectInput (see "Exceptions" in RevBank::Plugins) if the result is negative or more than 999.00.

Commas are changed to periods so 3,50 and 3.50 both result in 3.50.

parse_user($username)

Returns the canonical username, or undef if the account does not exist.

See parse_user in RevBank::Accounts for the gory details.

now

Returns the current local time as a string like 2026-09-26_13:37:00.

User, Amount, Description, Text, Enum

Parameter types for declared commands. See RevBank::Type.

slurp, spurt, append, rewrite, with_lock, mtime

File access in the data directory. See RevBank::FileIO.

Author

Juerd Waalboer #####@juerd.nl