NAME
Wildling - pattern based string generator
SYNOPSIS
use Wildling;
my $w = Wildling::create(
['Year 19##'],
{ colors => [qw(red blue)] }, # optional named dictionaries
);
while ( defined( my $value = $w->next() ) ) {
print "$value\n";
}
$w->reset();
print $w->get(0), "\n"; # first combination
print $w->count(), "\n"; # total combinations
DESCRIPTION
Wildling expands patterns with a shared wildcard grammar into every combination. Useful for wordlists, domain brainstorming, test data, and similar generation tasks.
This is the Perl port of the multi-language wildling project. Pattern syntax and CLI behaviour match the other ports; see the project docs:
https://dotmonk.github.io/wildling/syntax.html — pattern syntax
https://dotmonk.github.io/wildling/sandbox.html — browser sandbox
https://github.com/dotmonk/wildling/tree/main/perl — this port
The CLI ships as bin/wildling.pl (wildling.pl after install).
FUNCTIONS
create(\@patterns, \%dictionaries?)
Returns a Wildling::Client that enumerates all combinations of the given patterns. %dictionaries maps names used by %{'name'} tokens to arrayrefs of words. Omit or pass undef for no dictionaries.
is_false($value)
True when $value is undef — the sentinel for exhausted next() / out-of-range get(). Empty string combinations are defined and are not false in this sense.
METHODS
These methods are on the object returned by create.
next()
Next combination, or undef when exhausted.
get($index)
Combination at $index (0-based), or undef if out of range.
count()
Total number of combinations.
reset()
Rewind the next() cursor to the start.
index()
Current next() cursor position (number of values already yielded).
generators()
Arrayref of internal per-pattern generators (advanced use).
SEE ALSO
https://dotmonk.github.io/wildling/, https://metacpan.org/dist/Wildling
AUTHOR
Magnus Weinberg <magnus.weinberg@gmail.com>
LICENSE
MIT. See the LICENSE file in the distribution.