« Schema/perl/arraydata/modname_with_optional_args.pm
↑ Summary
Schema/perl/arraydata/modnames_with_optional_args.pm »
| 1 | package Sah::Schema::perl::arraydata::modnames; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |
| 7 | 1 | our $DATE = '2024-02-16'; # DATE | |
| 8 | 1 | our $DIST = 'Sah-SchemaBundle-ArrayData'; # DIST | |
| 9 | 1 | our $VERSION = '0.005'; # VERSION | |
| 10 | |||
| 11 | 1 | our $schema = [array => { | |
| 12 | summary => 'Array of Perl ArrayData::* module names without the prefix, e.g. ["Lingua::Word::ID::KBBI", "Number::Prime::First1000"]', | ||
| 13 | description => <<'_', | ||
| 14 | |||
| 15 | Array of Perl ArrayData::* module names, where each element is of | ||
| 16 | `perl::arraydata::modname` schema, e.g. `Word::ID::KBBI`, | ||
| 17 | `Number::Prime::First1000`. | ||
| 18 | |||
| 19 | Contains coercion rule that expands wildcard, so you can specify: | ||
| 20 | |||
| 21 | Word::ID::* | ||
| 22 | |||
| 23 | and it will be expanded to e.g.: | ||
| 24 | |||
| 25 | ["Word::ID::KBBI", "Word::ID::PERLANCAR"] | ||
| 26 | |||
| 27 | The wildcard syntax supports jokers (`?`, `*`, `**`), brackets (`[abc]`), and | ||
| 28 | braces (`{one,two}`). See <pm:Module::List::Wildcard> for more details. | ||
| 29 | |||
| 30 | _ | ||
| 31 | of => ["perl::arraydata::modname", {req=>1}, {}], | ||
| 32 | |||
| 33 | 'x.perl.coerce_rules' => [ | ||
| 34 | ['From_str_or_array::expand_perl_modname_wildcard', {ns_prefix=>'ArrayData'}], | ||
| 35 | ], | ||
| 36 | |||
| 37 | # provide a default completion which is from list of installed perl modules | ||
| 38 | 'x.element_completion' => ['perl_modname', {ns_prefix=>'ArrayData'}], | ||
| 39 | |||
| 40 | }]; | ||
| 41 | |||
| 42 | 1 | 1; | |
| 43 | # ABSTRACT: Array of Perl ArrayData::* module names without the prefix, e.g. ["Lingua::Word::ID::KBBI", "Number::Prime::First1000"] | ||
| 44 | |||
| 45 | __END__ | ||