1$OpenBSD: PkgSpec.pod,v 1.1 2020/12/20 15:30:58 daniel Exp $
2
3=head1 NAME
4
5OpenBSD::PkgSpec - C<packages-specs(7)> handling
6
7=head1 SYNOPSIS
8
9   use OpenBSD::Search; # which pulls in OpenBSD::PkgSpec when needed
10
11   my $spec = OpenBSD::Search::PkgSpec->new($pattern);
12   @sublist = $spec->filter(@list);
13
14=head1 DESCRIPTION
15
16C<OpenBSD::PkgSpec> is the canonical interface to C<packages-specs(7)>
17handling.
18
19A package specification C<$pattern> is a string that can be used to
20extract matching package names from a C<@list>.  The resulting list
21C<@sublist> will only hold the package names that match the specification.
22
23For performance reason, the result may contain duplicates.
24
25Note that any pattern will create a C<PkgSpec> object. If the syntax is
26incorrect, the resulting object won't match anything. Use
27C<$spec-E<gt>is_valid> to check for correctness.
28