Prototype mismatch: add_line_to_history
KeePass Command Line Interface
Brought to you by:
hightowe,
perlsaiyan
I am trying to run kpcli 2.8 for the first time on Mac OS X. I downloaded kpcli-2.8.pl, and installed the missing dependencies it complained about one by one using cpanminus. Now I get this:
Prototype mismatch: sub Term::ReadLine::Perl5::readline::add_line_to_history ($$) vs none at /Users/yitzg/bin/kpcli-2.8.pl line 4639.
Not an ARRAY reference at /System/Library/Perl/5.18/Term/ReadLine.pm line 307.
Any ideas? Thanks.
I need to know the versions of perl and Term::ReadLine::Perl5 that you are using. If kpcli will run, you can copy/paste the output of its vers command, else you'll need to just let me know yourself.
As a work around do this bug, kpcli will prefer Term::ReadLine::Gnu if it's available. If you install that module you likely will get going until I can understand the issue with Term::ReadLine::Perl5, which I suspect is a newer version than I've tested against before.
That's the classic issue on Mac OS X:
I spent some time looking at this. It seems to me that Term::ShellUI and recent Term::ReadLine::Perl5 aren't playing well together at all, at least not on Linux (and likely MaxOS X) and there does not appear to be any kpcli code triggering the problem. The support that I added for Term::ReadLine::Perl5 appears to have been at version 1.22 and was mostly targeted at Windows (although I'm sure it worked on Linux).
I've chased this issue far enough that I'm likely to not look at it again for a while; diminishing returns for me. If you cpanm down your Term::ReadLine::Perl5 version to 1.22 (sudo cpanm -f Term::ReadLine::Perl5@1.22) you'll get further (at least I did), but will still hit problems; this time with history handling... Maybe some Term::ReadLine::Perl5 version newer than 1.22 but older then 1.41 will work for you, but at the moment I don't have time to walk through those and try them -- sorry.
I spoke too soon... I tried one other Term::ReadLine::Perl5 version, 1.32, and it works.
I don't intend to "walk" through all the Term::ReadLine::Perl5 versions any time soon, but 1.32 may get you going and maybe you can walk through them yourself and open a bug report with the Term::ReadLine::Perl5 maintainer...
Sincerely,
Lester
It does work now with
Term::ReadLine::Perl5@1.32, thanks!But I am not an active Perl programmer, so I'm not sure if I'm the one to investigate the problem any further. I had to fight hard with
cpanmto get that downgraded. I'm not even sure which of the things I tried fixed it. And nowcpanmseems to be in an inconsistent state;cpanm --infostill reports thatTerm::ReadLine::Perl5is at 1.41.If you give me specific commands to run, I'd be happy to give it a try and report back what happened.
Thanks,
Yitz
The "cpanm --info" command shows you the most recent version available in CPAN -- has nothing to do with your local installation.
If you can install pmtools (http://search.cpan.org/~mlfisher/pmtools-1.01/) then you can use its pmvers command to show you what you have installed, like so:
hightowe@zion:~/$ pmvers Term::ReadLine::Perl5
1.32
There is a good chance that Term::ShellUI interaction with Term::ReadLine::Perl5 broke at some version greater than 1.32 and less than 1.41. Identifying which one and opening a bug report against Term::ReadLine::Perl5 would be a useful contribution, I think.
Reported in the p5-Term-ReadLine-Perl5 project as issue 8.
For the record until we get this fixed, the latest version of Term::ReadLine::Perl5 that works here is 1.38.
Starting with 1.39, I tried integrating another line editing program Caroline to address two related issues. That Readline isn't OO, has a lot of global state and therefore you can't have nested readline sessions which is something that happens for example if you are in console program and try to debug something inside that.
Term::ReadLine::Perl5 version 1.43 resolves this problem and so I am closing this bug.
Again though, thanks for all of the help.
Last edit: Lester Hightower 2015-06-20
Verified that it works for me. Thanks!