Skip Menu |

This queue is for tickets about the Config-Simple CPAN distribution.

Report information
The Basics
Id: 6252
Status: resolved
Priority: 0/
Queue: Config-Simple

People
Owner: Nobody in particular
Requestors: gbrock [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 4.55
Fixed in: (no value)



Subject: Parameter values with a trailing '\' charater not saved corretly
I was just writing a script that needed to store "C:\" in a config file. It looks like Config::Simple is failing to escape the \ on saving. Then when loading, it's interpreted a a line continuation, and retrieving the wrong value (for ini) or failing to load (simple, http). The following is a test script: use strict; use warnings; use Config::Simple; my $value = 'C:\\'; # Ends in a \ my $file = 'test.'; foreach my $syntax ('ini', 'http', 'simple') { print $syntax.": "; unlink($file.$syntax); my $cfg_out = Config::Simple->new(syntax => $syntax); $cfg_out->param('test.value', $value); $cfg_out->write($file.$syntax); print "Wrote=[$value] "; $cfg_out = undef; if (my $cfg_in = Config::Simple->new(filename => $file.$syntax, syntax => $syntax)) { my $input = $cfg_in->param('test.value'); print "Read=[$input] "; $cfg_in = undef; print $input eq $value ? "Ok\n" : "Not Ok\n"; } else { print "Failed to load\n"; } }
Fixed in 4.57 -- Sherzod Ruzmetov http://author.handalak.com