Skip Menu |

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

Report information
The Basics
Id: 106642
Status: resolved
Priority: 0/
Queue: Config-General

People
Owner: Nobody in particular
Requestors: mcarey [...] ucar.edu
Cc:
AdminCc:

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



Subject: -StoreDelimiter works even -SplitPolicy is not 'custom'
Date: Mon, 24 Aug 2015 15:15:51 -0600
To: bug-Config-General [...] rt.cpan.org
From: Maxwell Carey <mcarey [...] ucar.edu>
According to the docs: "Please note that the delimiter used when saving a config (save_file() or save_string()) will be chosen according to the current -SplitPolicy. If -SplitPolicy is set to 'guess' or 'whitespace', 3 spaces will be used to delimit saved options." However, even if -SplitPolicy is 'guess', the value of -StoreDelimiter is used: use strict; use warnings; use Config::General; my $conf = Config::General->new( -SplitPolicy => 'guess', -StoreDelimiter => ' = ' ); $conf->save_file('settings.conf', { foo => 'bar' }); __END__ foo = bar # not 'foo bar' Is this a documentation bug or a code bug?
Hi, Show quoted text
> Is this a documentation bug or a code bug?
Hm depends how you see it :) The code is written so that it doesn't touch StoreDelimiter if the user set it manually. So maybe I could make the POD more clear about this. On the other side it doesn't make sense to let the module guess the delimiter and then manually specify one for output. But maybe there are uses for such a strategy, e.g. parsing legacy configs and putting them into a normalized state? I'm really unsure. But overwriting a value of a configured parameter may break existing code, so I tend to change the documentation and leave the code as is. - Tom
Added POD to clarify this.