Data-Presenter

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


    - Version number incremented to 1.0 to alert users to major change of
interface.  writeformat-family of nine methods now takes list of key-value
pairs as arguments rather than simple list (which required keeping track of
order of arguments).  In Data::Presenter::[Package1] subclasses (those from
which objects are created), _init() now has $index assigned directly to
$data{index} rather than being element 0 of an array passed by reference to
$data{index}.  Extensive additional testing.  Use of Devel::Cover for coverage
analysis was used to trim unreachable code and bring all statement, condition
and subroutine coverage up to 100% and to bring all branch coverage except
open() and close() calls up as well.

0.69    Wed Nov 30 2005
    - Partial overhaul including extensive additions to test coverage and
documentation, but as yet no change in functionality.  Because a bug
(incorrect sorting when requesting sorting in descending order) was found,
this version was not uploaded to CPAN.  Instead, it was tarballed so that I
would have a reference point for the next version.  Because of severity of
bug, v0.68 was withdrawn from CPAN.

0.68    Sat Oct 23 2004
	- Corrected substandard code at +1005 Presenter.pm to avoid error "Bizarre copy of array" error when running tests under Devel::Cover

0.67    Sat Oct 23 2004
	- Corrected substandard code at +322 Presenter.pm to avoid error "Bizarre copy of hash in leave" error when running tests under Devel::Cover

0.66    Wed Jun  9 2004
	- POD correction only:  Corrected error in POD for Data::Presenter::Sample Medinsure which resulted in bad POD-to-HTML translation and bad display on search.cpan.org

0.65    Wed Jun  2 2004
	- Corrected Intersect.pm and Union.pm to avoid "Bizarre array assignment" error when installing under Perl 5.8.4 on Darwin.

0.64	Sun Oct  5 2003
	- Added method get_keys_seen();

0.63	Sun Aug 24 2003
	- Added method seen_one_column();

0.62	Sun Apr 13 2003
	- Corrected errors in documentation.

0.61	Sat Apr 12 2003
	- First upload to CPAN.

0.60	Sat Apr 12 2003
	- Begin preparation for public distribution.

Revision history of Data::Presenter prior to public distribution:

Data::Presenter versions 0.3 through 0.39 incorporate the following
corrections and improvements over version 0.2 which was released 10/28/2001.

=over 4

=item *

Introduced C<$index> as one of the variables specified in I<fields.XXX.data>,
imported into the main package and used as metadata inside the
Data::Presenter object.  This eliminates some hard-coding inside subroutines
C<_init()> and C<_extract_rows()> inside Data::Presenter::[subclass] packages. 
It also necessitated a revision of C<_build_sort_formula()>, a large part of
which was extricated into the separate subroutine C<_formula_engine()>.  This
for the first time permitted on index keys which were not entirely numerical.
 So now one can sort on, say, product serial numbers such as C<'24TY-789'>.

=item *

Established a package global hash C<%reserved> within I<Data::Presenter.pm>
and C<%reserved_partial> within I<Data::Presenter::Combo::Intersect.pm> and
I<Data::Presenter::Combo::Union.pm>.  These are hashes of words such as
'fields', 'parameters', 'index' and 'options' which are reserved for current
or future use as keys in the hash blessed into the Data::Presenter object. 
These keys generally have to be excluded when preparing Data::Presenter
selection, sorting and output methods.  The coding for this exclusion is must
easier if one can write:

    unless $reserved{$i} {
    # do something
    }

in contrast to the earlier:

    unless ($i eq 'fields' || $i eq 'parameters') {
    # do something
    }

=item * C<_format_picture_line()> and C<writeHTML()> now format numerical columns
flush-right.

=item *

A bug was fixed in C<_build_sort_formula()> that was causing 'HERNANDEZ' to
precede 'HERNAN' in alphabetical sorts.  This was caused by the internal use
of C<'|'> as the delimiter between array entries.  C<'|'> has a higher ASCII
position than any alphabetical or numerical character.  Hence 'HERNANDEZ|'
has a lower sorting value position than 'HERNAN|'.  This has been corrected
by substituting C<'!'> as the delimiter, since C<'!'> has a lower ASCII value
than any alphabetical or numerical character.  One side effect is that the
character C<'!'> may not appear in data being input into Data::Presenter
objects.

=item *

Clarified error messages in C<_validate_fields()> and C<_analyze_relation()>.

=item *

Up through v0.31, if the operator were to call C<writeformat()>,
C<writeformat_plus_header()> or any combination thereof I<more than once> in a
particular Perl script I<and if> in so doing the operator used any of the
entries in C<@fields> I<more than once> as an element in
C<@columns_selected>, then a warning would have been printed to STDERR
stating:

    Variable "[$some_variable]" is not imported at
    (eval 2 [or higher number]) line [some_line_number].

To illustrate using the previously discussed examples:

    @columns_selected = ('lastname', 'firstname', 'datebirth', 'cno');
    $sorted_data = $dp1->sort_by_column(\@columns_selected);
    $outputfile = 'format01.txt';
    $dp1->writeformat($sorted_data, \@columns_selected, $outputfile);

    @columns_selected =
    ('lastname', 'firstname', 'dateadmission', 'cno');
    $sorted_data = $dp1->sort_by_column(\@columns_selected);
    $outputfile = 'format01.txt';
    $dp1->writeformat($sorted_data, \@columns_selected, $outputfile);

would have generated warnings resembling these:

    Variable "$lastname" is not imported at (eval 2) line 10.
    Variable "$firstname" is not imported at (eval 2) line 10.
    Variable "$cno" is not imported at (eval 2) line 10.

The author had run the program on live data many times and these warnings
were never indicators of any incorrect output.  This warning message is
discussed in C<perldoc perldiag> and on page 975 of L<Camel|"REFERENCES"> at
'Variable ''%s'' is not imported%s'.  That discussion implies that this
warning would not have appeared if C<use strict> were not in effect. 
However, the author tested this by calling C<no strict> before
C<writeformat()> and returning to C<use strict> therefafter.  The warnings
continued to be thrown.

The author then ventured to post the problematic code on comp.lang.perl.misc
and had his hand properly slapped for improper use of symbolic references. 
In the course of the slapping, the slapper, Mark-Jason Dominus, suggested
using the Perl C<formline> function and format accumulator variable C<$^A> --
which internally power Perl formats -- instead of formats I<per se>.  At the
same time, MJD discovered a bug in Perl 5.6 which was enabling the author to
get valid data out of C<writeformat()> despite improper use of symbolic



( run in 1.179 second using v1.01-cache-2.11-cpan-5837b0d9d2c )