NAME
Configd::Syntax::Spaced - Config files that are a directive, some whitespace and a value.
VERSION
version 0.002
SYNOPSIS
package Configd::Language::spaced_example;
use parent qw{Configd::Syntax::Spaced};
sub files { return ( { path => '/etc/example.conf', mode => 0o644 } ) }
sub units { return ('example.service') }
sub repeats { my ( $self, $key ) = @_; return $key eq 'listen' }
DESCRIPTION
Four of the files here are the same shape:
Syslog yes
Canonicalization relaxed/simple
opendkim, opendmarc, redis and chrony all write configuration this way -- a directive, whitespace, and the rest of the line -- and differ only in which directives may be said twice. One reader and one writer between them, rather than four that drift apart.
A language in this shape subclasses this rather than Configd::Language, and says only what is its own: its files, its units, and which of its directives may be said more than once.
It lives under Configd::Syntax:: rather than Configd::Language:: because Configd finds languages by looking for modules under the latter, and a base class put there would be offered as a language somebody could adopt.
NAME
Configd::Syntax::Spaced - config files that are a directive, some whitespace and a value.
METHODS
$language->parse($text)
The directives in a fragment. Comments and blank lines come back as text with no key, so they keep their place in a file that is not merged.
$language->emit($directives)
The file those directives make.
Written as directive value, one space, rather than reproducing whatever column alignment the original had. Alignment is a property of a file somebody maintained by hand, and this file is generated from several of them.
SEE ALSO
Please see those modules/websites for more information related to this module.
BUGS
Please report any bugs or feature requests on the bugtracker website https://github.com/teodesian/perl-configd/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
AUTHORS
Current Maintainers:
George S. Baugh <george@troglodyne.net>
COPYRIGHT AND LICENSE
Copyright (c) 2026 Troglodyne LLC
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.