Skip Menu |

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

Report information
The Basics
Id: 15797
Status: resolved
Priority: 0/
Queue: Config-Std

People
Owner: Nobody in particular
Requestors: steven [...] knowmad.com
Cc:
AdminCc:

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



Subject: Loss of comments
When you have comments after a value, such as: key: value # comments!!! You lose the comments if you change the value preceding it and save it back to the file. So if I changed the above 'value' to 'newvalue' and then saved it would look like: key: newvalue Notice that the comment is lost.
Date: Fri, 18 Nov 2005 12:20:17 +1100
From: Damian Conway <damian [...] conway.org>
To: bug-Config-Std [...] rt.cpan.org
Subject: Re: [cpan #15797] Loss of comments
RT-Send-Cc:
Show quoted text
> When you have comments after a value, such as: > > key: value # comments!!! > > You lose the comments if you change the value preceding it and save it back to the file. > So if I changed the above 'value' to 'newvalue' and then saved it would
look like: Show quoted text
> > key: newvalue > > Notice that the comment is lost.
Apologies. That is actually a documentation bug. You aren't able to put comments on the same line as a config variable. If you look at the value that Std::Config would read in from your original specification, you'll see that it's treating that # as just another part of the value: print $config{""}{key}; # prints: "value # comments!!!" Yes, it's a pity that you can't put comments on the same line as a config var, but I made the judgement that it would be worse if you couldn't use # as part of a value. Sorry for the confusion. Damian
late close - documentation strengthened warning against doing this ...