X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=lib%2FCGI%2FEx%2FConf.pm;h=1288e7b735a1f30fb37880a32c4f31f66bd230f6;hp=60b2d99fed9c488823608b790ee3783932867bd5;hb=ed00221d27dfab1e82ec2ea040ab4c399a91c545;hpb=48c4840be1f154e262de2c161cb86dc5000dfe47 diff --git a/lib/CGI/Ex/Conf.pm b/lib/CGI/Ex/Conf.pm index 60b2d99..1288e7b 100644 --- a/lib/CGI/Ex/Conf.pm +++ b/lib/CGI/Ex/Conf.pm @@ -7,7 +7,7 @@ CGI::Ex::Conf - Conf Reader/Writer for many different data format types =cut ###----------------------------------------------------------------### -# Copyright 2006 - Paul Seamons # +# Copyright 2007 - Paul Seamons # # Distributed under the Perl Artistic License without warranty # ###----------------------------------------------------------------### @@ -25,10 +25,11 @@ use vars qw($VERSION %CACHE $HTML_KEY @EXPORT_OK + $NO_WARN_ON_FAIL ); @EXPORT_OK = qw(conf_read conf_write in_cache); -$VERSION = '2.05'; +$VERSION = '2.24'; $DEFAULT_EXT = 'conf'; @@ -133,8 +134,8 @@ sub conf_read { ### don't die if the file is not found - do die otherwise if (! -e $file) { - eval { die "Conf file $file not found" }; - warn "Conf file $file not found" if ! $args->{'no_warn_on_fail'}; + eval { die "Conf file $file not found\n" }; + warn "Conf file $file not found" if ! $args->{'no_warn_on_fail'} && ! $NO_WARN_ON_FAIL; return; } @@ -261,6 +262,7 @@ sub read_handler_json { open (IN, $file) || die "Couldn't open $file: $!"; CORE::read(IN, my $text, -s $file); close IN; + require JSON; return scalar JSON::jsonToObj($text); } @@ -803,7 +805,7 @@ conf_read and conf_write method calls. =head1 FUNCTIONS -=over4 +=over 4 =item conf_read @@ -908,13 +910,13 @@ without even opening the file. Make a similar write method that handles immutability. -=head1 AUTHOR - -Paul Seamons - =head1 LICENSE This module may be distributed under the same terms as Perl itself. +=head1 AUTHOR + +Paul Seamons + =cut