Subject: | [patch] stat() on unopened filehandle warning thrown when using filehandle made from a scalar |
$ echo -e "[bar]\nfoo=baz_file" > /tmp/lol.ini && PERL5LIB=. perl -wle
'use Config::IniFiles; print "VERSION: $Config::IniFiles::VERSION"; my
$a = "[bar]\nfoo=baz_str\n"; open my $sfh, "<", \$a; open my $ffh,"<",
"/tmp/lol.ini"; for my $fh ($sfh, $ffh) { my $c = Config::IniFiles->new
(-file => $fh); print $c->val("bar","foo");}'
VERSION: 2.56
baz_str
baz_file
$ echo -e "[bar]\nfoo=baz_file" > /tmp/lol.ini && perl -wle 'use
Config::IniFiles; print "VERSION: $Config::IniFiles::VERSION"; my $a =
"[bar]\nfoo=baz_str\n"; open my $sfh, "<", \$a; open my $ffh,"<", "/tmp/
lol.ini"; for my $fh ($sfh, $ffh) { my $c = Config::IniFiles->new(-file
=> $fh); print $c->val("bar","foo");}'
VERSION: 2.56
stat() on unopened filehandle $sfh at /usr/share/perl5/Config/
IniFiles.pm line 766.
baz_str
baz_file
$ diff /usr/share/perl5/Config/IniFiles.pm Config/IniFiles.pm
764c764
< if (ref($fh) ne "IO::Scalar")
---
Show quoted text
> if (ref($fh) ne "IO::Scalar" && -e $fh)