… | |
… | |
1100 | while (my ($name, $cb) = each %hook) { |
1100 | while (my ($name, $cb) = each %hook) { |
1101 | my $htype = $HOOKTYPE{uc $name}; |
1101 | my $htype = $HOOKTYPE{uc $name}; |
1102 | defined $htype |
1102 | defined $htype |
1103 | or Carp::croak "unsupported hook type '$name'"; |
1103 | or Carp::croak "unsupported hook type '$name'"; |
1104 | |
1104 | |
1105 | $self->set_should_invoke ($htype, +1) |
1105 | $self->modify_should_invoke_count ($htype, +1) |
1106 | unless exists $self->{term}{_hook}[$htype]{$pkg}; |
1106 | unless exists $self->{term}{_hook}[$htype]{$pkg}; |
1107 | |
1107 | |
1108 | $self->{term}{_hook}[$htype]{$pkg} = $cb; |
1108 | $self->{term}{_hook}[$htype]{$pkg} = $cb; |
1109 | } |
1109 | } |
1110 | } |
1110 | } |
… | |
… | |
1116 | for my $name (@hook) { |
1116 | for my $name (@hook) { |
1117 | my $htype = $HOOKTYPE{uc $name}; |
1117 | my $htype = $HOOKTYPE{uc $name}; |
1118 | defined $htype |
1118 | defined $htype |
1119 | or Carp::croak "unsupported hook type '$name'"; |
1119 | or Carp::croak "unsupported hook type '$name'"; |
1120 | |
1120 | |
1121 | $self->set_should_invoke ($htype, -1) |
1121 | $self->modify_should_invoke_count ($htype, -1) |
1122 | if delete $self->{term}{_hook}[$htype]{$pkg}; |
1122 | if delete $self->{term}{_hook}[$htype]{$pkg}; |
1123 | } |
1123 | } |
1124 | } |
1124 | } |
1125 | |
1125 | |
1126 | our $AUTOLOAD; |
1126 | our $AUTOLOAD; |