The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

LRpt::JarReader - A module for reading jar record format files.

DESCRIPTION

This class is a part of LRpt library. Object of this class provides an easy interface to jar record format file.

METHODS

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:

rules

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

filename

Name of a file, which should be read as input

filehandle

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.

SEE ALSO

The project is maintained on Source Forge http://lreport.sourceforge.net. You can find there links to some helpful documentation like tutorial.

AUTHORS

Piotr Kaluski <pkaluski@piotrkaluski.com>

COPYRIGHT

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.