diff options
Diffstat (limited to 'lib/Tie/Hash.pm')
-rw-r--r-- | lib/Tie/Hash.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Tie/Hash.pm b/lib/Tie/Hash.pm index 928b798e45..c6ec3d4f5c 100644 --- a/lib/Tie/Hash.pm +++ b/lib/Tie/Hash.pm @@ -102,6 +102,7 @@ good working examples. =cut use Carp; +use warnings::register; sub new { my $pkg = shift; @@ -113,8 +114,8 @@ sub new { sub TIEHASH { my $pkg = shift; if (defined &{"${pkg}::new"}) { - carp "WARNING: calling ${pkg}->new since ${pkg}->TIEHASH is missing" - if $^W; + warnings::warn "WARNING: calling ${pkg}->new since ${pkg}->TIEHASH is missing" + if warnings::enabled(); $pkg->new(@_); } else { |