Subject: | A call to the stat method throws an exception |
Date: | Thu, 09 Jul 2020 01:52:42 +0300 |
To: | bug-IO-Callback [...] rt.cpan.org |
From: | alti [...] kribrum.ru |
When calling the stat method, an exception occurs
Can't use an undefined value as a SCALAR reference at
....../IO/String.pm line 358.
The reason is that in the basic IO::String, the buffer is called 'buf'
(all characters are lowercase), and in IO::Callback the buffer is called
'Buf' (first character in upper case).
Modules:
p5-IO-String-1.08
p5-IO-Callback-1.12
Perl:
This is perl 5, version 30, subversion 3 (v5.30.3) built for
amd64-freebsd-thread-multi
System:
FreeBSD riga 12.1-RELEASE-p2 FreeBSD 12.1-RELEASE-p2 GENERIC amd64
Code showing the problem:
use IO::Callback;
my $count = 0;
my $fh = IO::Callback->new('<', sub {return if ++$count > 10;return
"foo\n";},[]);
print $fh->stat;