From: Vincent Pit Date: Sun, 25 Jul 2010 17:20:18 +0000 (+0200) Subject: Rename $func to $name X-Git-Tag: v0.06~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=38d92c601799850a3428bf919c6b9f8ba1877cb5;p=perl%2Fmodules%2Fsubs-auto.git Rename $func to $name --- diff --git a/lib/subs/auto.pm b/lib/subs/auto.pm index 928ea7e..c0be5aa 100644 --- a/lib/subs/auto.pm +++ b/lib/subs/auto.pm @@ -106,13 +106,13 @@ sub _reset { } sub _fetch { - (undef, my $data, my $func) = @_; + (undef, my $data, my $name) = @_; return if $data->{guard}; local $data->{guard} = 1; - return if $func =~ /::/ - or exists $core{$func}; + return if $name =~ /::/ + or exists $core{$name}; my $op_name = $_[-1] || ''; return if $op_name =~ /method/; @@ -121,11 +121,11 @@ sub _fetch { my $hints = (caller 0)[10]; if ($hints and $hints->{+(__PACKAGE__)}) { - my $pm = $func . '.pm'; + my $pm = $name . '.pm'; return if exists $INC{$pm}; - my $fqn = $pkg . '::' . $func; - my $cb = do { no strict 'refs'; *$fqn{CODE} }; + my $fqn = $pkg . '::' . $name; + my $cb = do { no strict 'refs'; *$fqn{CODE} }; if ($cb) { if (_REFCNT_PLACEHOLDERS and defined(my $data = getdata(&$cb, $tag))) { ++$$data; @@ -144,19 +144,19 @@ sub _fetch { no strict 'refs'; *$fqn = $cb; } else { - _reset($pkg, $func); + _reset($pkg, $name); } return; } sub _store { - (undef, my $data, my $func) = @_; + (undef, my $data, my $name) = @_; return if $data->{guard}; local $data->{guard} = 1; - _reset($data->{pkg}, $func); + _reset($data->{pkg}, $name); return; }