- return unless @_ == 3;
- not defined and return for @_;
- my ($cb, $to) = @_[1, 2];
- return hook_print $_[0], sub {
- my @args = @{$_[0]};
- if ($cb->(@args)) {
- $reorder{$to}->(@args) if exists $reorder{$to};
- emit_print $to, @args;
- return EAT_ALL;
- } else {
- return EAT_NONE;
- }
- }