Bug#400921: Config::IniFiles cannot be used against an empty file

gregor herrmann gregor+debian at comodo.priv.at
Sat Apr 5 18:34:39 UTC 2008


On Wed, 29 Nov 2006 17:28:33 +0100, Vidar.Loken.Johannessen at virtek.no wrote:

> Trying to open an empty file (that exists) and add a section. Get error 
> message "Can't call method "AddSection" on an undefined value at test.pl 
> line 7."

I'm not sure if this is actually a bug; the documentation says:

 If this option ["-file" on ->new()] is not specified, (i.e. you are
 creating a config file from scratch) you must specify a target file
 using SetFileName in order to save the parameters.

If I change your example to ...

~~~~~~~~~~~~~
#!/usr/bin/perl
use strict;
use Config::IniFiles;

my $cfg = Config::IniFiles->new();
$cfg->SetFileName('empty.ini');
$cfg->AddSection("abc");
$cfg->RewriteConfig();  
~~~~~~~~~~~~~

... there are no more errors.


Would it be alright if I close this bug?

Cheers,
gregor                 
-- 
 .''`.   http://info.comodo.priv.at/ | gpg key ID: 0x00F3CFE4
 : :' :  debian: the universal operating system - http://www.debian.org/
 `. `'   member of https://www.vibe.at/ | how to reply: http://got.to/quote/
   `-    NP: Cranberries: Dreams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20080405/65a0ff12/attachment.pgp 


More information about the pkg-perl-maintainers mailing list