Skip Menu |
 

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

Report information
The Basics
Id: 45588
Status: resolved
Priority: 0/
Queue: Config-IniFiles

People
Owner: Nobody in particular
Requestors: cg [...] mcs.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 2.47
  • 2.48
Fixed in: (no value)



Subject: Failure to read config from a scalar
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1241083439-10159-512"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 624
Download (untitled) / with headers
text/plain 624b
When passing a reference to a scalar as -file argument, Config::IniFiles failes to read the configuration using IO::Scalar. Instead, it will try to open the reference as a file. The following one-liner will reproduce the problem as will the test script attached to this report: perl -e 'use Config::IniFiles; my $data="[foo]\nbar=baz\n"; my $cfg = new Config::IniFiles -file=>\$data;' I do have IO::Scalar Version 2.110 installed. The problem seems to result from line 2043 of Version 2.48 of IniFiles.pm, where only IO::Scalar is required but the VERSION of IO::Stringy is checked. Thanks in advanve for your efforts!
Subject: test.pl
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_1241083438-10159-511"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Charset: utf8
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 0
Content-Type: application/octet-stream; name="test.pl"
Content-Disposition: inline; filename="test.pl"
Content-Transfer-Encoding: base64
Content-Length: 215
Download test.pl
text/x-perl 215b
use Config::IniFiles; my $contents = <<EOT; [dummy] foo = bar EOT my $cfg = new Config::IniFiles( -file => \$cfg_contents ); print $Config::IniFiles::VERSION, "\n"; print $IO::Scalar::VERSION, "\n";
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Charset: utf8
Content-Type: text/plain
Message-ID: <rt-3.6.HEAD-4108-1241275000-1160.45588-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 269
Download (untitled) / with headers
text/plain 269b
Hi! Thanks for reporting this bug. OK, I can confirm this bug existed, and was opposed to the documented behaviour. I fixed it in the Subversion repository, and uploaded a corrected Config::IniFiles as release 2.49 to CPAN. Thanks, again. Regards, -- Shlomi Fish


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.