summaryrefslogtreecommitdiff
path: root/lib/Tie/Scalar.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Tie/Scalar.pm')
-rw-r--r--lib/Tie/Scalar.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Tie/Scalar.pm b/lib/Tie/Scalar.pm
index 1e2caee379..0c6759006f 100644
--- a/lib/Tie/Scalar.pm
+++ b/lib/Tie/Scalar.pm
@@ -79,6 +79,7 @@ process IDs with priority.
=cut
use Carp;
+use warnings::register;
sub new {
my $pkg = shift;
@@ -90,8 +91,8 @@ sub new {
sub TIESCALAR {
my $pkg = shift;
if (defined &{"{$pkg}::new"}) {
- carp "WARNING: calling ${pkg}->new since ${pkg}->TIESCALAR is missing"
- if $^W;
+ warnings::warn "WARNING: calling ${pkg}->new since ${pkg}->TIESCALAR is missing"
+ if warnings::enabled();
$pkg->new(@_);
}
else {