/me looks around a little confused
but didn't you just export Carp subs and rename them under Wx::Carp?
No, that's not all I did. Instead of warning or dieing, Wx::LogFatalError and Wx::LogWarning are called.

I use Carp; all the time. When I write CGI apps, I use CGI::Carp, cause it does things appropriate for a CGI environment.

Ah, that makes me think I should've put die and warn in there, i'll do that, thanks.

###################################################################### +####### ## Name: Carp.pm ## Purpose: Wx::Perl::Carp class (a replacement for Carp in Wx app +lications) ## Author: D.H. aka PodMaster ## Modified by: ## Created: 12/24/2002 ## RCS-ID: ## Copyright: (c) 2002 D.H. ## Licence: This program is free software; you can redistribute it + and/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; @ISA = qw( Exporter ); @EXPORT = qw( confess croak carp die warn); @EXPORT_OK = qw( cluck verbose ); @EXPORT_FAIL = qw( verbose ); # hook to enable verbose mo +de 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;
update: i've renamed it to Wx::Perl::Carp in keeping with what Mattia setup.


MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
** The Third rule of perl club is a statement of fact: pod is sexy.


In reply to Re: Re: Wx::Carp - a replacement for Carp in Wx applications by PodMaster
in thread Wx::Carp - a replacement for Carp in Wx applications by PodMaster

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.