DBIx-Class-InflateColumn-Boolean

Perl does not have a native boolean data type by itself, it takes certain
several scalar values as "false" (like '', 0, 0.0) as well as empty lists
and "undef", and everything else is "true". It is also possible to set the
boolean value of an object instance.

As in most program code you have boolean data in nearly every database.
But for a database it is up to the designer to decide what is "true" and
what is "false".

This module maps such "database booleans" into "Perl booleans" and back by
inflating designated columns into some sort of boolean objects, that happen
to be instances of Contextual::Return::Value.  Objects of this class can
store the original value and a boolean meaning at the same time. Therefore
- if "Yes" in the database means "true" and "No" means "false", in the
application the following two lines virtually mean the same:

  if ($table->field eq "No") { ... }
  if (not $table->field) { ... }

That means that "$table->field" has the scalar value "No", but is taken as
"false" in a boolean context, whereas without the little magic from
Contextual::Return Perl would regard the string "No" as "true".

When writing to the database, of course "$table->field" would be deflated
to the original value "No" and not some Perlish form of a boolean.


INSTALLATION

To install this module, run the following commands:

	perl Makefile.PL
	make
	make test
	make install

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the
perldoc command.

    perldoc DBIx::Class::InflateColumn::Boolean

You can also look for information at:

    RT, CPAN's request tracker
        http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class-InflateColumn-Boolean

    AnnoCPAN, Annotated CPAN documentation
        http://annocpan.org/dist/DBIx-Class-InflateColumn-Boolean

    CPAN Ratings
        http://cpanratings.perl.org/d/DBIx-Class-InflateColumn-Boolean

    Search CPAN
        http://search.cpan.org/dist/DBIx-Class-InflateColumn-Boolean


COPYRIGHT AND LICENCE

Copyright (C) 2008 Bernhard Graf

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.