Command history in the perl debugger

Command history in the perl debugger

If you’re one of the rare people that prefers the perl debugger over warn() statements everywhere in your code you will benefit from a functioning command history in the debugger.

1 minute read

I’m always forgetting what pieces I need to make this happen, so I’m writing a note to my future self.

Ubuntu Packages

Install:

  • libncurses-dev
  • libreadline-dev

Perl Packages

Install:

  • Term::ReadLine::Gnu

Save a little time with puppet

Include these somewhere and run a puppet update:

class libncurses-dev {
    package { libncurses-dev: ensure => latest }
}

class libreadline-dev {
    package { libreadline-dev: ensure => latest }
}

Save the history to a file

Add this to ~/.perldb

# file: "~/.perldb"
&parse_options("HistFile=$ENV{HOME}/.perldb.hist");

(This is a repost of a post made to blogs.perl.org in 2013)

Attribution

Some images require attribution links as part of their terms: