XAS::Lib::Counter - A Perl extension for the XAS environment
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');
This module will maintain a table of counters. These counters are numeric and start from 1.
This will initialize the base object. It takes the following parameters:
This is the database schema where the Counter table resides.
This will increment the named counter by one and return the result.
The name of the counter.
This will decrement the named counter by one and return the result;
This will reset the named counter to one and return the result.
This will return the current value of the named counter.
Kevin L. Esteb, <kevin@kesteb.us>
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.
To install XAS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XAS
CPAN shell
perl -MCPAN -e shell install XAS
For more information on module installation, please visit the detailed CPAN module installation guide.