LRpt::JarReader - A module for reading jar record format files.
This class is a part of LRpt library. Object of this class provides an easy interface to jar record format file.
LRpt
In this sections you will find a more or less complete listing of all methods provided by the package. Note that the package itself is not public so none of those methods are guaranteed to be maintained in future (including the package itself).
new
my $jr = LRpt::JarReader->new( rules => $rules, filename => $filename, filehandle => $filehandle );
Constructor. Three parameters are allowed:
A reference to a list defining the expected layout of the input file. Each entry of the list is a reference to a hash describing rules for one entry. Each hash may have the following keys:
name => Name of en entry in a section. This parameter is mandatory
mandatory => Specifies if an entry is mandatory. The default is '1' which means 'mandatory'. If an entry is mandatory, it is an error not to specify it.
trim => Specifies if traling spaces of an entry value should be trimmed. Default is 1, i.e. trim
Name of a file, which should be read as input
Filehandle to a file, which should be read as input
read_all
$jr->read_all();
Parses the input file. Creates a list containing values for all sections. Each item from the list is a reference to a section. Each section is a hash, where key is an entry name and value is an entry value.
check_mandatory
$jr->check_mandatory( $section );
Checks if the current section contains all mandatory entries (and does necessary trimming).
get_section_with
$jr->get_section_with( %entry );
Returns a reference to a section containing an entry of a given name, having a given value.
get_all_values_of
$jr->get_all_values_of( $name )
Returnes a list of all values of a given entry in all sections.
The project is maintained on Source Forge http://lreport.sourceforge.net. You can find there links to some helpful documentation like tutorial.
Piotr Kaluski <pkaluski@piotrkaluski.com>
Copyright (c) 2004-2006 Piotr Kaluski. Poland. All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
To install LRpt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LRpt
CPAN shell
perl -MCPAN -e shell install LRpt
For more information on module installation, please visit the detailed CPAN module installation guide.