The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Devel::ModuleBreaker - set breakpoints for every subroutine in a namespace simultaneously

VERSION

0.02

SYNOPSIS

    $ perl -d:ModuleBreaker=Module1,Another::Module2 script_to_debug.pl

DESCRPITION

Devel::ModuleBreaker seeks to simplify the process of settings breakpoints in a collection of subroutines from one or more modules, without having to enumerate the list of subroutines in the modules.

This module was inspired by a StackOverflow question.

This distribution also comes with the packages

Devel::SubBreaker

to automatically set breakpoints in any compile-time subroutine whose name matches a regular expression

Devel::FileBreaker

to automatically set breakpoints in any compile-time subroutine loaded from a filename that matches a regular expression

USAGE

To use this module, pass this command-line argument to perl

    -d:ModuleBreaker=pattern[,pattern2[,...]]

where pattern, pattern2, etc. are any valid perl regular expressions. In the CHECK phase of the program, a breakpoint will be set at the start of any subroutine whose fully qualified subroutine name (given by %DB::sub) matches one of the given regular expressions. This includes anonymous subroutines that are known at compile time.

EXAMPLES

  • Set a breakpoint in all subs just in module Floop::Blert:

        perl -d:ModuleBreaker=Floop::Blert ...

SUPPORT

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

    perldoc Devel::ModuleBreaker

You can also look for information at:

SEE ALSO

Devel::SubBreaker, Devel::FileBreaker

AUTHOR

Marty O'Brien, <mob at cpan.org>

LICENSE AND COPYRIGHT

Copyright 2018 Marty O'Brien

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 http://dev.perl.org/licenses/ for more information.