| 1 | package DB::Pluggable::Constants; |
|---|
| 2 | |
|---|
| 3 | use strict; |
|---|
| 4 | use warnings; |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | our $VERSION = '0.03'; |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | use base 'Exporter'; |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | our %EXPORT_TAGS = ( |
|---|
| 14 | util => [ qw(HANDLED DECLINED) ], |
|---|
| 15 | ); |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | our @EXPORT_OK = @{ $EXPORT_TAGS{all} = [ map { @$_ } values %EXPORT_TAGS ] }; |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | use constant HANDLED => '200'; |
|---|
| 22 | use constant DECLINED => '500'; |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | 1; |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | __END__ |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | =head1 NAME |
|---|
| 33 | |
|---|
| 34 | DB::Pluggable::Constants - Constants for debugger plugin hook methods |
|---|
| 35 | |
|---|
| 36 | =head1 SYNOPSIS |
|---|
| 37 | |
|---|
| 38 | package DB::Pluggable::MyUsefulCommand; |
|---|
| 39 | |
|---|
| 40 | use DB::Pluggable::Constants ':all'; |
|---|
| 41 | |
|---|
| 42 | sub do_it { |
|---|
| 43 | my ($self, $context, $args) = @_; |
|---|
| 44 | ... |
|---|
| 45 | if (...) { |
|---|
| 46 | ... |
|---|
| 47 | return HANDLED; |
|---|
| 48 | } else { |
|---|
| 49 | return DECLINED; |
|---|
| 50 | } |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | =head1 DESCRIPTION |
|---|
| 54 | |
|---|
| 55 | This module defines constants that should be used by hooks as return values. |
|---|
| 56 | The following constants are defined: |
|---|
| 57 | |
|---|
| 58 | =over 4 |
|---|
| 59 | |
|---|
| 60 | =item HANDLED |
|---|
| 61 | |
|---|
| 62 | This constant should be returned by a command-related hook method to indicate |
|---|
| 63 | that it has handled the debugger command. |
|---|
| 64 | |
|---|
| 65 | =item DECLINED |
|---|
| 66 | |
|---|
| 67 | This constant should be returned by a command-related hook method to indicate |
|---|
| 68 | that it has not handled the debugger command. |
|---|
| 69 | |
|---|
| 70 | =back |
|---|
| 71 | |
|---|
| 72 | L<DB::Pluggable>'s plugin-enabled replacements for the debugger commands use |
|---|
| 73 | these constants to determine whether a command has been handled by one of the |
|---|
| 74 | plugins or whether it should be passed on to the default command handler |
|---|
| 75 | defined in C<perl5db.pl>. |
|---|
| 76 | |
|---|
| 77 | =head1 BUGS AND LIMITATIONS |
|---|
| 78 | |
|---|
| 79 | No bugs have been reported. |
|---|
| 80 | |
|---|
| 81 | Please report any bugs or feature requests through the web interface at |
|---|
| 82 | L<http://rt.cpan.org>. |
|---|
| 83 | |
|---|
| 84 | =head1 INSTALLATION |
|---|
| 85 | |
|---|
| 86 | See perlmodinstall for information and options on installing Perl modules. |
|---|
| 87 | |
|---|
| 88 | =head1 AVAILABILITY |
|---|
| 89 | |
|---|
| 90 | The latest version of this module is available from the Comprehensive Perl |
|---|
| 91 | Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a CPAN |
|---|
| 92 | site near you. Or see <http://www.perl.com/CPAN/authors/id/M/MA/MARCEL/>. |
|---|
| 93 | |
|---|
| 94 | =head1 AUTHORS |
|---|
| 95 | |
|---|
| 96 | Marcel GrE<uuml>nauer, C<< <marcel@cpan.org> >> |
|---|
| 97 | |
|---|
| 98 | =head1 COPYRIGHT AND LICENSE |
|---|
| 99 | |
|---|
| 100 | Copyright 2008 by the authors. |
|---|
| 101 | |
|---|
| 102 | This library is free software; you can redistribute it and/or modify |
|---|
| 103 | it under the same terms as Perl itself. |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | =cut |
|---|
| 107 | |
|---|