File: Carp.pm

package info (click to toggle)
libwx-perl 1%3A0.9909-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,912 kB
  • sloc: cpp: 9,728; perl: 8,182; ansic: 626; makefile: 41
file content (61 lines) | stat: -rw-r--r-- 1,676 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#############################################################################
## Name:        ext/pperl/carp/Carp.pm
## Purpose:     Wx::Perl::Carp module (a replacement for Carp in Wx
##              applications)
## Author:      D.H. aka PodMaster
## Modified by:
## Created:     12/24/2002
## RCS-ID:      $Id: Carp.pm 2057 2007-06-18 23:03:00Z mbarbon $
## Copyright:   (c) 2002 D.H.
## Licence:     This program is free software; you can redistribute itand/or
##              modify it under the same terms as Perl itself
#############################################################################

=head1 NAME

Wx::Perl::Carp  - a replacement for Carp in Wx applications

=head1 SYNOPSIS

Just like L<Carp>, so go see the L<Carp> pod (cause it's based on L<Ca
+rp>).

    # short example
    Wx::Perl::Carp;
    ...
    carp "i'm warn-ing";
    croak "i'm die-ing";

=head1 SEE ALSO

L<Carp> L<Carp> L<Carp> L<Carp> L<Carp>

=head1 COPYRIGHT

(c) 2002 D.H. aka PodMaster (a proud CPAN author)

=cut

package Wx::Perl::Carp;

BEGIN {
    require Carp;
    require Wx;
}

use Exporter;
$VERSION     = '0.01';
@ISA         = qw( Exporter );
@EXPORT      = qw( confess croak carp die warn);
@EXPORT_OK   = qw( cluck verbose );
@EXPORT_FAIL = qw( verbose );              # hook to enable verbose mode

sub export_fail { Carp::export_fail( @_) } # make verbose work for me
sub croak   { Wx::LogFatalError( Carp::shortmess(@_) ) }
sub confess { Wx::LogFatalError( Carp::longmess(@_) ) }
sub carp    { Wx::LogWarning( Carp::shortmess(@_) ) }
sub cluck   { Wx::LogWarning( Carp::longmess(@_) ) }
sub warn    { Wx::LogWarning( @_ ) }
sub die     { Wx::LogFatalError( @_ ) }

1;