|
|
- A basic filter
- --------------
-
- <!-- exec-raw cat examples/filter_authors.pl -->
- #!/usr/bin/env perl
-
- use warnings;
- use strict;
- use 5.10.0;
-
- # Extract name where given name matches "John":
- while (<>) {
- say "$2 $1" if m/^(.*)\t(Jo.*?)(\t|$)/i;
- }
- <!-- end -->
-
- <!-- exec -->
-
- $ ./examples/filter_authors.pl examples/authors.tsv
- John Brunner
- John Tolkien
- Jo Walton
-
- <!-- end -->
|