package C4::Boolean;
-
#package to handle Boolean values in the parameters table
# Note: This is just a utility module; it should not be instantiated.
# Suite 330, Boston, MA 02111-1307 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;
}