DB::Color - Colorize your debugger output


Version 0.06


Put the following in your $HOME/.perldb file:

 sub afterinit {
     push @DB::typeahead, "{{v"
       unless $DB::already_curly_curly_v++;
 use DB::Color;

Then use your debugger like normal:

 perl -d


If the NO_DB_COLOR environment variable is set to a true value, syntax highlighting will be disabled.


No, sorry. It's a combination of bad Windows support for ANSI escape sequences and bad debugger design.


Syntax highlighting the code is very, very slow. As a result, we cache the output files in $HOME/.perldbcolor. This is done by calculating the md5 sum of the file contents. If the file is changed, we get a new sum. This means that syntax highlighting is very slow at first, but every time you hit the same file, assuming its unchnanged, the cached version is served first.

Note that the cache files are removed after they become 30 days old without being used. This has merely been a naive hack for a proof of concept. Patches welcome.


This is only a proof of concept. In fact, it's fair to say that this code sucks. It's not very configurable and has bugs. It's also going to possibly be a memory hog, as if the debugger wasn't bad enough already.


Curtis "Ovid" Poe, <ovid at>


Please report any bugs or feature requests to bug-db-color at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc DB::Color

You can also look for information at:


Thanks to Nick Perez, Liz, and the 2012 Perl Hackathon for helping to overcome some major hurdles with this module.


Copyright 2011 Curtis "Ovid" Poe.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.