Carp-Source
view release on metacpan or search on metacpan
lib/Carp/Source/Always.pm view on Meta::CPAN
my $arg = pop @_;
$arg =~ s/ at .*? line .*?\n$//s;
push @_, $arg;
}
$Carp::Source::CarpLevel = 1;
die Carp::Source::longmess_heavy(join('', grep { defined } @_), %options);
}
my %OLD_SIG;
BEGIN {
@OLD_SIG{qw(__DIE__ __WARN__)} = @SIG{qw(__DIE__ __WARN__)};
$SIG{__DIE__} = \&_die;
$SIG{__WARN__} = \&_warn;
}
END {
no warnings 'uninitialized';
@SIG{qw(__DIE__ __WARN__)} = @OLD_SIG{qw(__DIE__ __WARN__)};
}
1;
__END__
=pod
=head1 NAME
Carp::Source::Always - Warns and dies with stack backtraces and source code context
=head1 VERSION
version 1.101420
=head1 DESCRIPTION
This module is meant as a debugging aid.
use Carp::Source::Always;
makes every C<warn()> and C<die()> complain loudly, with stack traces and
source code context like L<Carp::Source>, in the calling package and
elsewhere. It can also be used on the command line:
perl -MCarp::Source::Always script.pl
You can specify the same options as L<Carp::Source>'s C<source_cluck()> takes,
separated by commas. For example:
perl -MCarp::Source::Always=lines,5,color,'yellow on_blue' script.pl
It does not work for one-liners because there is no file from which to load
source code.
This module does not play well with other modules which modify with
C<warn>, C<die>, C<$SIG{__WARN__}>, or C<$SIG{__DIE__}>.
=head1 INSTALLATION
See perlmodinstall for information and options on installing Perl modules.
=head1 BUGS AND LIMITATIONS
No bugs have been reported.
Please report any bugs or feature requests through the web interface at
L<http://rt.cpan.org/Public/Dist/Display.html?Name=Carp-Source>.
=head1 AVAILABILITY
The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit L<http://www.perl.com/CPAN/> to find a CPAN
site near you, or see
L<http://search.cpan.org/dist/Carp-Source/>.
The development version lives at
L<http://github.com/hanekomu/Carp-Source/>.
Instead of sending patches, please fork this project using the standard git
and github infrastructure.
=head1 AUTHOR
Marcel Gruenauer <marcel@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2007 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 2.522 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )