… | |
… | |
1570 | }; |
1570 | }; |
1571 | |
1571 | |
1572 | =item regex => $accept[, $reject[, $skip], $cb->($handle, $data) |
1572 | =item regex => $accept[, $reject[, $skip], $cb->($handle, $data) |
1573 | |
1573 | |
1574 | Makes a regex match against the regex object C<$accept> and returns |
1574 | Makes a regex match against the regex object C<$accept> and returns |
1575 | everything up to and including the match. |
1575 | everything up to and including the match. All the usual regex variables |
|
|
1576 | ($1, %+ etc.) from the regex match are available in the callback. |
1576 | |
1577 | |
1577 | Example: read a single line terminated by '\n'. |
1578 | Example: read a single line terminated by '\n'. |
1578 | |
1579 | |
1579 | $handle->push_read (regex => qr<\n>, sub { ... }); |
1580 | $handle->push_read (regex => qr<\n>, sub { ... }); |
1580 | |
1581 | |