# LibTmux::PaneSelection::grep

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** Perl
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-perl/blob/352715a4fa66a96eed7763b90daaa536aa2f121d/packages/core/lib/LibTmux/Selection.pm#L54
- **Inherited from:** LibTmux::Selection
- **Page:** https://libtmux.org/en/perl/latest/reference/libtmux-paneselection-grep/

```
sub grep($self, $callback)
```

`grep($callback)` returns a new same-class selection. Invoke the callback in scalar context with exactly one entity argument and a localized `$_`. Both bindings hold copies of the reference: assignment cannot replace a source slot. Restore `$_` and propagate the original thrown value even on failure. Predicates must not edit the traversed sequence.

## Methods

## Parameters

- `callback`
