Subject: | Term::ReadLine versus EOF char (^D) |
cpan[1]> Use of uninitialized value in subroutine entry at
/usr/libdata/perl5/Term/ReadLine.pm line 200.
Use of uninitialized value in subroutine entry at
/usr/libdata/perl5/Term/ReadLine.pm line 200.
So the code takes the undef from ^D and then tries to utf8::upgrade it
(line 200), so in theory somewhere before that there should be an
is-undef-whoops-do-something case?
sub readline {
my $self = shift;
my ($in,$out,$str) = @$self;
my $prompt = shift;
print $out $rl_term_set[0], $prompt, $rl_term_set[1], $rl_term_set[2];
$self->register_Tk
if not $Term::ReadLine::registered and $Term::ReadLine::toloop
and defined &Tk::DoOneEvent;
#$str = scalar <$in>;
$str = $self->get_line;
$str =~ s/^\s*\Q$prompt\E// if ($^O eq 'MacOS');
utf8::upgrade($str)
if (${^UNICODE} & PERL_UNICODE_STDIN || defined ${^ENCODING}) &&
utf8::valid($str);
print $out $rl_term_set[3];
# bug in 5.000: chomping empty string creats length -1:
chomp $str if defined $str;
$str;
}