Debian...arning(3pm)
π Debian::DEP12::ValidationWarning(3pm) β bestie edition π
okay so this is a page from the User Contributed Perl Documentation section, and the star of the show is Debian::DEP12::ValidationWarning, a lil class that holds onto your validation warnings like a notes-app girlie who never loses a receipt. let's get into it π
β¨ NAME β¨
Debian::DEP12::ValidationWarning β the validation warning class. yes bestie, it's giving "structured complaint" energy and we love her for it π
β¨ SYNOPSIS β¨
use Debian::DEP12::ValidationWarning;
my $warning = Debian::DEP12::ValidationWarning->new(
'value \'%(value)s\' is better written as \'%(suggestion)s\'',
{
field => 'Bug-Submit',
value => 'merkys@cpan.org',
suggestion => 'mailto:merkys@cpan.org',
}
);
print STDERR "$warning\n";
look at her go π¦ you build one, you print it to STDERR, done. no cap.
β¨ DESCRIPTION β¨
Debian::DEP12::ValidationWarning exists so a validation warning's content can be stored in a structured way instead of just vibing as a loose string. and ngl, right now the class is built on top of Text::BibTeX::Validate::Warning β but she might get decoupled in the future, so don't get too attached to that ancestry, iykyk π
β¨ METHODS β¨
πΈ new( $message, $fields )
takes a Text::sprintfn-compatible template plus a hash holding the values you wanna swap into that template. classic.
now here's the tea: three field names are reserved and get used as message prefixes if they're defined:
fileβ the name of a filekeyβ the index inside a listfieldβ the DEP12 field name
and one more that's a lil special: suggestion. Debian::DEP12 might use its value to replace the original, in an attempt to clean up the DEP12 entry. so she's not just decorative, she's got a job π
πΈ fields()
returns an array of the fields defined in the instance β in any order, so don't come for her about sorting π«Ά
πΈ get( $field )
returns the value of a field. simple. iconic.
πΈ set( $field, $value )
sets a new value for a field, and returns the old value. so you always get the receipts back π§Ύβ¨
πΈ delete( $field )
unsets the value for a field, and also returns the old value. bye bestie, but here's what you were π
β¨ AUTHORS β¨
Andrius Merkys, <merkys@cpan.org> π
heads up bestie: thesuggestionfield isn't just any old key βDebian::DEP12may use it to replace the original while cleaning up the DEP12 entry, so treat it with main character respect π
and that's the whole page, fr fr π this was rendered by perl v5.40.0 on 2024-09-28, so go forth and validate, you absolute queen ππ
π¦ where this page comes from
- ubuntu resolute: libdebian-dep12-perl 0.2.0-1 Β· BSD-3-Clause
- ubuntu stonking: libdebian-dep12-perl 0.2.0-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms