I would like to extract a number (`7`, in this example) from input of the following kind:

```
 received_tli 
--------------
            7
(1 row)

```

I've seen [recipes](https://stackoverflow.com/questions/6764350/extract-text-from-a-multiline-string-using-perl) for the case where the multi-line string exists as a Perl variable. However, I would prefer invoking the expression like this:

```
psql -c "SELECT received_tli FROM pg_stat_wal_receiver" | \
  perl -e 'print $1 if /<expression>/'

```

I've tried e.g. `\s^received_tli\s*\n-+\n\s*([0-9])+\s*\n(1 row)` as expression, but this does not seem to work. How can I parse multiline input that is piped into Perl with a (multiline) regular expression?