Skip to content
A Perl diagnostic debug package.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Debug - Perl extension for placing "debug" messages throughout your code, which will be displayed - if enabled - to STDERR at program termination.


use Debug;


  • debuglog() function

This enables or disables debug output. Usually at the "top" of the code.


Passing 0 disables debug output - which can occur anytime after being enabled.

  • debug() function

This is the "diagnostic" creation function. It is passed a variable whose value is wanted to "be checked" or otherwise examined.

The "diagnostic" part of the output is the "two back" back trace, something like:

(,39,funca)(,43,funcb) b

which is sub funcb called by sub funca with a scalar.

References will be needed to display non-scalars properly. For example:

my %k = ('key',1);

Output would be like:

(,24,-) {'key'=>1}

(A single back trace means debug() was in "main".)

See Also


Copyright (C) 2018 by Andova Begarin

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.22.3 or, at your option, any later version of Perl 5 you may have available.

You can’t perform that action at this time.