summaryrefslogtreecommitdiff
path: root/lib/Tie/Scalar.pm
diff options
context:
space:
mode:
authorchromatic <chromatic@wgz.org>2001-09-28 15:20:12 -0600
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-29 13:49:43 +0000
commitc6c73c786b4d4a71e6f053b58104cf6488c744a4 (patch)
treeef24bea7e5a9ee87fed78d86afa86f778d365df8 /lib/Tie/Scalar.pm
parentd9efae67d76cc4acd8980b711b5bebc7142b5319 (diff)
downloadperl-c6c73c786b4d4a71e6f053b58104cf6488c744a4.tar.gz
Add tests, clean up Tie::Scalar
Message-ID: <20010929032543.58322.qmail@onion.perl.org> p4raw-id: //depot/perl@12265
Diffstat (limited to 'lib/Tie/Scalar.pm')
-rw-r--r--lib/Tie/Scalar.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Tie/Scalar.pm b/lib/Tie/Scalar.pm
index bcaad0b11e..c23c12187a 100644
--- a/lib/Tie/Scalar.pm
+++ b/lib/Tie/Scalar.pm
@@ -92,7 +92,7 @@ sub new {
sub TIESCALAR {
my $pkg = shift;
- if (defined &{"{$pkg}::new"}) {
+ if ($pkg->can('new') and $pkg ne __PACKAGE__) {
warnings::warnif("WARNING: calling ${pkg}->new since ${pkg}->TIESCALAR is missing");
$pkg->new(@_);
}