package C4::Boolean;
-# $Id$
-
#package to handle Boolean values in the parameters table
# Note: This is just a utility module; it should not be instantiated.
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
+use warnings;
+
use POSIX;
-require Exporter;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-# set the version for version checking
-$VERSION = 0.01;
+BEGIN {
+ # set the version for version checking
+ $VERSION = 0.02;
+ require Exporter;
+ @EXPORT = qw(
+ &INVALID_BOOLEAN_STRING_EXCEPTION
+ );
+ @EXPORT_OK = qw(
+ true_p
+ );
+ @ISA = qw(Exporter);
+}
=head1 NAME
=cut
-@ISA = qw(Exporter);
-@EXPORT = (
- &INVALID_BOOLEAN_STRING_EXCEPTION
- );
-
-@EXPORT_OK = qw(
- true_p
- );
-
sub INVALID_BOOLEAN_STRING_EXCEPTION ()
{ 'The given value does not seem to be interpretable as a Boolean value' }
my($x) = @_;
my $it;
if (!defined $x || ref($x) ne '') {
- die INVALID_BOOLEAN_STRING_EXCEPTION;
+ warn INVALID_BOOLEAN_STRING_EXCEPTION;
}
$x = lc($x);
$x =~ s/\s//g;
if (defined $strings{$x}) {
$it = $strings{$x};
} else {
- die INVALID_BOOLEAN_STRING_EXCEPTION;
+ warn INVALID_BOOLEAN_STRING_EXCEPTION;
}
return $it;
}
=head1 AUTHOR
-Koha Developement team <info@koha.org>
+Koha Development Team <info@koha.org>
=cut