X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=C4%2FBoolean.pm;h=d8c14fbd9dca01beaa050a82b07e04c2eb1ffd28;hb=f4e77ec1df31cedf88cbde3aa6a81a782780fc10;hp=fee3917d5ddfd045a39f2f0890fb8f8b1f005754;hpb=47aa996a11d182ba6f60bd54f30af7989b46496f;p=koha.git diff --git a/C4/Boolean.pm b/C4/Boolean.pm index fee3917d5d..d8c14fbd9d 100644 --- a/C4/Boolean.pm +++ b/C4/Boolean.pm @@ -1,7 +1,5 @@ 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. @@ -19,18 +17,29 @@ package C4::Boolean; # 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 @@ -54,15 +63,6 @@ Boolean values in a consistent way which makes common sense. =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' } @@ -94,14 +94,14 @@ sub true_p ($) { 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; } @@ -118,6 +118,6 @@ __END__ =head1 AUTHOR -Koha Developement team +Koha Development Team =cut