Skip Menu |

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

Report information
The Basics
Id: 100272
Status: rejected
Priority: 0/
Queue: Config-IniFiles

People
Owner: Nobody in particular
Requestors: johann [...] myrkraverk.com
Cc:
AdminCc:

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



Subject: @Config::IniFiles::errors get concatenated on a malformed ini file
Date: Tue, 11 Nov 2014 12:00:26 +0000
To: bug-Config-IniFiles [...] rt.cpan.org
From: "Johann 'Myrkraverk' Oskarsson" <johann [...] myrkraverk.com>
Hi, With an ini file consisting only of the following malformed section name [huh, with or without newlines, error messages get concatenated together. Like so: $ ./initest.pl Line 2 in file /path/to/initest.ini is mal-formed: [huhEmpty file treated as error at ./initest.pl line 10. initest.ini: [huh initest.pl: #!/usr/bin/perl use warnings; use strict; use Config::IniFiles; my $config_file = '/path/to/initest.ini'; my $config = Config::IniFiles->new( -file => $config_file ) or die @Config::IniFiles::errors; -- Johann I'm not from the internet, I just work there.
Hi Johann, On Tue Nov 11 14:18:33 2014, johann@myrkraverk.com wrote: Show quoted text
> Hi, > > With an ini file consisting only of the following malformed section > name [huh, with or without newlines, error messages get concatenated > together. Like so: > > $ ./initest.pl > Line 2 in file /path/to/initest.ini is mal-formed: > [huhEmpty file treated as error at ./initest.pl line 10. >
The errors are not concatenated - it's just what happens when you pass an array to die: shlomif@telaviv1:~$ perl -d initest.pl Loading DB routines from perl5db.pl version 1.44 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(initest.pl:7): my $config_file = './initest.ini'; DB<76> n main::(initest.pl:8): if (! ( my $config = Config::IniFiles->new( -file => $config_file )) ) main::(initest.pl:9): { DB<76> n main::(initest.pl:10): die @Config::IniFiles::errors; DB<76> x @Config::IniFiles::errors 0 "Line 1 in file ./initest.ini is mal-formed:\cJ\cI[huh" 1 'Empty file treated as error' DB<77> So it's not a bug in Config-IniFiles, but rather an expected behaviour of perl's die. Closing as rejected. Bye!
Subject: initest.pl
#!/usr/bin/perl use strict; use warnings; use Config::IniFiles; my $config_file = './initest.ini'; if (! ( my $config = Config::IniFiles->new( -file => $config_file )) ) { die @Config::IniFiles::errors; }