Hello,

I am trying to use Config::Properties module (http://search.cpan.org/
~salva/Config-Properties-1.70/Properties.pm). I am able to read the
properties and use them. However I am finding an issue while changing
a property value.

Here is my script:
==============================

#!/usr/bin/perl

use Config::Properties;

open PROPS, "+< download.properties" or die $!;

$properties = new Config::Properties();
$properties->load(*PROPS);

$currentDate = $properties->getProperty("currentDate");

$currentDate = "Changed";

$properties->changeProperty("currentDate", $currentDate);
$properties->save(*PROPS);

close PROPS;

==================================

What I am trying to do is to read the "download.properites" file first
and then change the value for "currentDate" and then store it back to
property file. Most of this works. But while writing it back to the
property file it appends all the properties at the end. This way
property file size goes on increasing on each run.

Is there way I can do in-place replacement and avoid the duplication?

Thanks
-Vallabha


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to