CPAN RT

This sample script extracts every text element matching a given pattern (string or regex) from a source document and appends it to a target document.
The target document must be an existing one (empty or not).

The first argument of the command line is the source file name,
the second one is the target file,
the third one is the selection filter (i.e.
any quoted string or Perl regular expression)