In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/a930c511fcc6cf6f5ef849a9a4a028ff1cd6e27a?hp=5115136b5ada1a3245a69b04d93664e445e85eb1>

- Log -----------------------------------------------------------------
commit a930c511fcc6cf6f5ef849a9a4a028ff1cd6e27a
Author: David Mitchell <[email protected]>
Date:   Mon Aug 17 00:31:45 2009 +0100

    [perl #68530] "version::CLASS" warning in Safe.pm
    If any of the std variables being aliased into the Safe::rootN
    package don't actually exist, and if they are not one of the special
    "don't warn" variables, then you can get an 'only used once' warning.
    So lets not. (Also bumps version number).
-----------------------------------------------------------------------

Summary of changes:
 ext/Safe/Safe.pm |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ext/Safe/Safe.pm b/ext/Safe/Safe.pm
index 9d3d589..b27c047 100644
--- a/ext/Safe/Safe.pm
+++ b/ext/Safe/Safe.pm
@@ -3,7 +3,7 @@ package Safe;
 use 5.003_11;
 use strict;
 
-$Safe::VERSION = "2.17";
+$Safe::VERSION = "2.17_01";
 
 # *** Don't declare any lexicals above this point ***
 #
@@ -243,13 +243,15 @@ sub share_from {
        my ($var, $type);
        $type = $1 if ($var = $arg) =~ s/^(\W)//;
        # warn "share_from $pkg $type $var";
-       *{$root."::$var"} = (!$type)       ? \&{$pkg."::$var"}
+       for (1..2) { # assign twice to avoid any 'used once' warnings
+           *{$root."::$var"} = (!$type)       ? \&{$pkg."::$var"}
                          : ($type eq '&') ? \&{$pkg."::$var"}
                          : ($type eq '$') ? \${$pkg."::$var"}
                          : ($type eq '@') ? \...@{$pkg."::$var"}
                          : ($type eq '%') ? \%{$pkg."::$var"}
                          : ($type eq '*') ?  *{$pkg."::$var"}
                          : croak(qq(Can't share "$type$var" of unknown type));
+       }
     }
     $obj->share_record($pkg, $vars) unless $no_record or !$vars;
 }

--
Perl5 Master Repository

Reply via email to