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