Reputation: 1211
I just noticed that the functionality of Term::ReadLine has changed (for the worse) after upgrading from a gcc4 compiled version of perl to a gcc6 compiled version. With gcc4, the backspace key was interpreted correctly, allowing the user to edit the line he/she was entering. The gcc6 version apparently does not, returning a ^? every time the backspace key is entered.
Here's some simple code I used to test this...
#!/tool/pandora64/.package/perl-5.24.0-gcc620/bin/perl5.24.0
#/tool/pandora64/.package/perl-5.24.0/bin/perl5.24.0
use strict;
use Term::ReadLine;
my $answer;
my $term = Term::ReadLine->new('EDIT_STDIN');
$term->ornaments(0);
$answer = $term->readline("Enter something here....");
print "answer: $answer\n";
exit;
As it is, this script fails to interpret the backspace key correctly as described above. Swap lines 1 and 2 and it works fine.
Sooooo..... any ideas why this is happening? Any suggestions on how to get this to work given that I can't go back to gcc4 ?
Upvotes: 2
Views: 63
Reputation: 1211
In this particular case, the problem was that Term::ReadLine::Gnu was missing for Perl 5.24.0-gcc620 . After installed, it runs fine.
Upvotes: 1