develooper Front page | perl.perl5.porters | Postings from May 2018

[perl #130021] Wrong context determined for <>/IO::Handle::getlinein debug mode

From:
KES via RT
Date:
May 15, 2018 12:00
Subject:
[perl #130021] Wrong context determined for <>/IO::Handle::getlinein debug mode
Message ID:
rt-4.0.24-12799-1526385633-1096.130021-15-0@perl.org
I minify testcase. This is occur only when I do call to Time::HiRes::gettimeofday

$ cat Devel/DB.pm
package DB;

sub DB {
}

use Time::HiRes qw/ gettimeofday /;
sub sub {
	print "$DB::sub is called\n";
	# my $t =  [ gettimeofday ]; # <<< Uncomment this to get error

	return &$DB::sub;
}

1;

$ cat t.pl
use IO::Handle();
1;


$ perl -d:DB t.pl
...
strict::unimport is called
strict::bits is called
IO::Handle::_create_getline_subs is called
String found where operator expected at (eval 4)[Devel/DB.pm:11] line 2, near "croak 'usage: $io->getline()'"
	(Do you need to predeclare croak?)
syntax error at (eval 4)[Devel/DB.pm:11] line 2, near "croak 'usage: $io->getline()'"
Compilation failed in require at t.pl line 1.
BEGIN failed--compilation aborted at t.pl line 1.



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=130021



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About