VisSection - handler to manipulate sections in VisRep.pl.
use Data::Reporter::VisSection; $section = new Data::Reporter::VisSection(); $section->configure(Name => 'mydetail', Lines => ('line 1', 'line 2', 'line 3'), Code => "print 'this is the detail section\n';", Size => 3, Break_field => 0, Width => 20, Only_code => 0); my $name = $section->name(); my $size = $section->size(); my $break_field = $section->break_field(); my @lines = $section->lines(); my $code = $section->code(); my $only_code = $section->only_code(); $section->append("print 'this is the last line of code\n'); $section->insert("print 'this is the first line of code\n'"); open OUT, "out.txt"; $section->generate(\*OUT);
Creates a new section handler
valid options are:
Name Section name
Lines array of Lines to be printed in this section
Code Code to execute before printing the data section
Size Number of lines in the section
Break_field Field number in which the break applies
Width Numbers of columns in section
Only_code Indicator for a no-lines section
Returns the section's name
Returns the section's size
Returns the section's break_field
Returns an array with the section`s lines
Returns the section's Code
Returns the only_code indicator
Print perl code in OUT handler. This code is the section's information
A section is a part of a report. For example the header section, the title section, etc. Each section has two parts:
This contains perl code, which is executed before printing the data lines of the section. This is useful because you can prepare the data to print in the report or acumulate totals. The special variable @field, is used to print data in lines.
Here are the lines to print. The lines are printed using the RepFormat module, there are special fields in printing the lines:
This field generates code to print $field[n]
This field generates code to print $report->page(n). page is a special feature from Reporter module
This field generates code to print $report->time(n). time is a special feature from Reporter module
This field generates code to print $report->date(n). date is a special feature from Reporter module
4 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You can't have =items (as at line 43) unless the first thing after the =over is an =item
You forgot a '=back' before '=head1'
=over without closing =back
To install Data::Reporter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Reporter
CPAN shell
perl -MCPAN -e shell install Data::Reporter
For more information on module installation, please visit the detailed CPAN module installation guide.