This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Detypo.
[perl5.git] / lib / Tie / Scalar.pm
index 39480c8..c23c121 100644 (file)
@@ -47,7 +47,7 @@ For developers wishing to write their own tied-scalar classes, the methods
 are summarized below. The L<perltie> section not only documents these, but
 has sample code as well:
 
-=over
+=over 4
 
 =item TIESCALAR classname, LIST
 
@@ -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(@_);
     }