Permalink
Browse files

Fix the hinting for pragma use

  • Loading branch information...
sirhc committed Dec 29, 2011
1 parent 4c5920d commit acb2af6b15753e3b2dc81b54ee4dca5c141e345e
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Carp/Syslog.pm
View
@@ -41,17 +41,17 @@ sub import {
*{ $caller . '::confess' } = \&Carp::confess;
}
- $^H{+__PACKAGE__} = 1;
+ $^H{'Carp::Syslog'} = 1;
}
sub unimport {
- $^H{+__PACKAGE__} = 0;
+ $^H{'Carp::Syslog'} = 0;
}
sub _my_warn {
- my $hints = ( caller(0) )[10];
+ my $hints = ( caller 1 )[10];
- if ( $hints->{+__PACKAGE__} ) {
+ if ( $hints->{'Carp::Syslog'} ) {
_my_syslog( 'warning', $_[0] );
}
@@ -61,9 +61,9 @@ sub _my_warn {
sub _my_die {
# We don't want to log exception objects.
if ( !ref $_[0] ) {
- my $hints = ( caller(0) )[10];
+ my $hints = ( caller 1 )[10];
- if ( $hints->{+__PACKAGE__} ) {
+ if ( $hints->{'Carp::Syslog'} ) {
_my_syslog( 'err', $_[0] );
}
}

0 comments on commit acb2af6

Please sign in to comment.