]> git.vpit.fr Git - perl/modules/Sub-Op.git/blobdiff - lib/Sub/Op.pm
We don't need $fqn in enable()/disable()
[perl/modules/Sub-Op.git] / lib / Sub / Op.pm
index 1702f3ee49e731d9efe9ea53b62943571b3a2ad1..76d22dacb4dab4ba36869b65ecbceaf8353ffae7 100644 (file)
@@ -242,8 +242,6 @@ sub enable {
  my $name = shift;
 
  my $pkg = @_ > 0 ? $_[0] : caller;
- my $fqn = "${pkg}::$name";
-
  my $map = _map($pkg);
 
  if (defined $map) {
@@ -272,8 +270,6 @@ sub disable {
  my $name = shift;
 
  my $pkg = @_ > 0 ? $_[0] : caller;
- my $fqn = "${pkg}::$name";
-
  my $map = _map($pkg);
 
  if (defined $map) {
@@ -331,7 +327,7 @@ sub _inject {
   $B_OP_inject{can} = sub {
    my ($obj, $meth) = @_;
    if ($meth eq 'first') {
-    return undef unless defined _custom_name($obj);
+    return undef unless $obj->isa('B::UNOP') or defined _custom_name($obj);
    }
    $obj->SUPER::can($meth);
   };
@@ -374,7 +370,7 @@ BEGIN { _monkeypatch() }
 
 =head1 EXAMPLES
 
-See the F<t/Sub-Op-Test> directory that implements a complete example.
+See the F<t/Sub-Op-LexicalSub> directory that implements a complete example.
 
 =head1 DEPENDENCIES