Kevin L. Esteb > XAS-0.04 > XAS::Lib::Counter

Download:
XAS-0.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source   Latest Release: XAS-0.05

NAME ^

XAS::Lib::Counter - A Perl extension for the XAS environment

SYNOPSIS ^

 use XAS::Lib::Counter;

 my $counter = XAS::Lib::Counter->new(
    -database = $database
 );

 my $value = $counter->inc('jobid');
 my $value = $counter->dec('jobid');
 my $value = $counter->value('jobid');
 my $value = $counter->reset('jobid');

DESCRIPTION ^

This module will maintain a table of counters. These counters are numeric and start from 1.

METHODS ^

new

This will initialize the base object. It takes the following parameters:

-database

This is the database schema where the Counter table resides.

inc($name)

This will increment the named counter by one and return the result.

$name

The name of the counter.

dec($name)

This will decrement the named counter by one and return the result;

$name

The name of the counter.

reset($name)

This will reset the named counter to one and return the result.

$name

The name of the counter.

value($name)

This will return the current value of the named counter.

$name

The name of the counter.

SEE ALSO ^

XAS

AUTHOR ^

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE ^

Copyright (C) 2012 by Kevin Esteb

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: