mirror of
https://codeberg.org/scip/Config-General.git
synced 2025-12-17 12:41:07 +01:00
1.35 - the here-doc identifier in saved configs will now created
in a way which avoids the existence of this identifier
inside the here-doc, which if it happens results in
weird behavior in the resulting config.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@24 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
1.35 - the here-doc identifier in saved configs will now created
|
||||||
|
in a way which avoids the existence of this identifier
|
||||||
|
inside the here-doc, which if it happens results in
|
||||||
|
weird behavior in the resulting config.
|
||||||
|
|
||||||
1.34 - Danial Pearce <danial@infoxchange.net.au> reported a bug
|
1.34 - Danial Pearce <danial@infoxchange.net.au> reported a bug
|
||||||
in _store(), which caused the module to create scalar
|
in _store(), which caused the module to create scalar
|
||||||
entries even if the entry contained newlines. While
|
entries even if the entry contained newlines. While
|
||||||
|
|||||||
28
General.pm
28
General.pm
@@ -1,12 +1,11 @@
|
|||||||
#
|
#
|
||||||
# Config::General.pm - Generic Config Module
|
# Config::General.pm - Generic Config Module
|
||||||
#
|
#
|
||||||
# Purpose: Provide a convenient way
|
# Purpose: Provide a convenient way for loading
|
||||||
# for loading config values from a
|
# config values from a given file and
|
||||||
# given file and return it as hash
|
# return it as hash structure
|
||||||
# structure
|
|
||||||
#
|
#
|
||||||
# Copyright (c) 2000-2001 Thomas Linden <tom@daemon.de>.
|
# Copyright (c) 2000-2002 Thomas Linden <tom@daemon.de>.
|
||||||
# All Rights Reserved. Std. disclaimer applies.
|
# All Rights Reserved. Std. disclaimer applies.
|
||||||
# Artificial License, same as perl itself. Have fun.
|
# Artificial License, same as perl itself. Have fun.
|
||||||
#
|
#
|
||||||
@@ -18,7 +17,7 @@ use strict;
|
|||||||
use Carp;
|
use Carp;
|
||||||
use Exporter;
|
use Exporter;
|
||||||
|
|
||||||
$Config::General::VERSION = "1.33";
|
$Config::General::VERSION = "1.35";
|
||||||
|
|
||||||
use vars qw(@ISA @EXPORT);
|
use vars qw(@ISA @EXPORT);
|
||||||
@ISA = qw(Exporter);
|
@ISA = qw(Exporter);
|
||||||
@@ -616,12 +615,23 @@ sub _write_scalar {
|
|||||||
|
|
||||||
if ($line =~ /\n/) {
|
if ($line =~ /\n/) {
|
||||||
# it is a here doc
|
# it is a here doc
|
||||||
|
my $delimiter;
|
||||||
|
my $tmplimiter = "EOF";
|
||||||
|
while (!$delimiter) {
|
||||||
|
# create a unique here-doc identifier
|
||||||
|
if ($line =~ /$tmplimiter/s) {
|
||||||
|
$tmplimiter .= "%";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$delimiter = $tmplimiter;
|
||||||
|
}
|
||||||
|
}
|
||||||
my @lines = split /\n/, $line;
|
my @lines = split /\n/, $line;
|
||||||
$config_string .= $indent . $entry . " <<EOF\n";
|
$config_string .= $indent . $entry . " <<$delimiter\n";
|
||||||
foreach (@lines) {
|
foreach (@lines) {
|
||||||
$config_string .= $indent . $_ . "\n";
|
$config_string .= $indent . $_ . "\n";
|
||||||
}
|
}
|
||||||
$config_string .= $indent . "EOF\n";
|
$config_string .= $indent . "$delimiter\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# a simple stupid scalar entry
|
# a simple stupid scalar entry
|
||||||
@@ -1467,7 +1477,7 @@ Thomas Linden <tom@daemon.de>
|
|||||||
|
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
1.34
|
1.35
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user