NAME
Text::CSV::TrackMAX - module to work with .csv file that stores some maximum value per identificator
VERSION
v1.0 - created to track last login time
SYNOPSIS
use Text::CSV::TrackMAX;
#create object
my $access_time = Text::CSV::TrackMAX->new({ file_name => $file_name, ignore_missing_file => 1 });
#store value
$access_time->max_value_of($login, $access_time);
#fetch value
print max_value_of($login);
#save changes
$access_time->store();
#print out all the indentificators we have
foreach my $login (sort $access_time->ident_list()) {
print "$login\n";
}
DESCRIPTION
the module reads csv file:
"identificator","numeric value" ...
and can return the numeric value for the identificator or update it
METHODS
- new()
-
new({ file_name => 'filename.csv' ignore_missing_file => 1 }) both file_name and ignore_missing_file are optional. 'file_name' is used to read old results and then store the updated ones if 'ignore_missing_file' is set then the lib will just warn that it can not read the file. store() will use this name to store the results.
- max_value_of()
-
is used to both store or retrieve the value. if called with one argument then it is a read. if called with two arguments then it will update the value. The update will be done ONLY if the supplied value is bigger.
- store()
-
when this one is called it will write the changes back to file
- ident_list()
-
will return the array of identificators
AUTHOR
Jozef Kutej <jozef.kutej@hp.com>