HayoBaan has asked for the wisdom of the Perl Monks concerning the following question:

Since upgrading to Mac OS X Yosemite (perl 5.18), the perl debugger crashes when I try to use the tab completion on variable names. To test, run perl -d -e '42', and then at the debug prompt type x @A followed by a TAB character. The debug session will die with below error. Any idea what going on? This used to work fine on Mavericks (perl 5.16).

$ perl -d -e '42' Loading DB routines from perl5db.pl version 1.39_10 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): 42 DB<1> x @ACan't use string ("::") as a HASH ref while "strict refs" +in use at /System/Library/Perl/5.18/perl5db.pl line 9513. at /System/Library/Perl/5.18/perl5db.pl line 9513. DB::db_complete('@A', 'x @A', 2) called at sub readline::completio +n_matches line 10 readline::completion_matches('CODE(0x7fcfa1bb1988)', '@A', 'x @A', + 2) called at sub readline::complete_internal line 27 readline::complete_internal('\x{9}') called at sub readline::F_Com +plete line 16 readline::F_Complete(1, 9) called at /Library/Perl/5.18/Term/ReadL +ine/readline.pm line 1669 readline::readline(' DB<1> ') called at /Library/Perl/5.18/Term/R +eadLine/Perl.pm line 11 Term::ReadLine::Perl::readline('Term::ReadLine::Perl=ARRAY(0x7fcfa +182c4b8)', ' DB<1> ') called at /System/Library/Perl/5.18/perl5db.pl + line 7281 DB::readline(' DB<1> ') called at /System/Library/Perl/5.18/perl5 +db.pl line 1831 DB::_DB__read_next_cmd(undef) called at /System/Library/Perl/5.18/ +perl5db.pl line 2741 DB::DB called at -e line 1 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info.

Replies are listed 'Best First'.
Re: Perl debugger variable completion crashing debugger
by choroba (Cardinal) on Apr 14, 2015 at 19:31 UTC
    See commit c3970b803:
    @@ -9385,7 +9385,7 @@ If the package is C<::> (C<main>), create an emp +ty list; if it's something else, =cut push @out, map "$prefix$_", grep /^\Q$text/, - ( grep /^_?[a-zA-Z]/, keys %$pack ), + ( grep /^_?[a-zA-Z]/, do { no strict 'refs'; keys %$pack } +), ( $pack eq '::' ? () : ( grep /::$/, keys %:: ) ); =item *
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      Thanks! That do { no strict… seemed to fix it 😄

      Short of installing a new version of perl, is there an easy way to upgrade this core file in an existing installation?

      For now I have simply copied perl5db.pl to a location earlier in the @INC path and made the little change, that works, but I'd actually like a cleaner way. Hmm, I could of course fix the file in /System/Library/Perl/5.18 too, but somehow I'd rather not 😮

      Note too that reverting to the still existing 5.16 installation using export VERSIONER_PERL_VERSION=5.16 worked as well, of course.

Re: Perl debugger variable completion crashing debugger
by LanX (Saint) on Apr 14, 2015 at 18:04 UTC
    > x @ACan't use string ("::") as a HASH ref while "strict refs" in use

    I'm pretty sure the debugger's code is older than strict.

    Maybe someone tried to fix this and didn't test enough.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

Re: Perl debugger variable completion crashing debugger
by Laurent_R (Canon) on Apr 14, 2015 at 18:01 UTC
    I did not know about tab completion under the Perl debugger. Thanks, HayoBaan, it will be useful for me, since it does not die either for me (but I am under 5.14).

    Je suis Charlie.

      You're welcome 😀, I'm sadly not any closer to solving it under 5.18 though 😟

Re: Perl debugger variable completion crashing debugger
by adefaria (Beadle) on Apr 14, 2015 at 15:59 UTC
    Doesn't die on me but I'm on Perl 5.20 on Ubuntu 14.10.