Text::...Warning(3pm)
π Text::...Warning(3pm) β Text::BibTeX::Validate::Warning π
okay bestie, so this page lives in the User Contributed Perl Documentation manual, and it's all about the validaton warning class. yes. we're doing warnings. but like, β¨structuredβ¨ warnings.
πΈ NAME πΈ
Text::BibTeX::Validate::Warning β the validaton warning class π
β¨ SYNOPSIS β¨
use Text::BibTeX::Validate::Warning;
my $warning = Text::BibTeX::Validate::Warning->new(
'value \'%(value)s\' is better written as \'%(suggestion)s\'',
{
field => 'month',
value => '1',
suggestion => 'Jan',
}
);
print STDERR "$warning\n";
look at her go ππ
π¦ DESCRIPTION π¦
so like, Text::BibTeX::Validate::Warning is the little container where the content of a validation warning lives β the ones emitted by Text::BibTeX::Validate β except it stores them in a structured way instead of just being a sad little string. no cap.
and because she's a class with manners, overloads are defined so you can stringify her and compare instances of the class. she's giving main character energy, fr fr. π₯
π METHODS π
π new( $message, $fields )
okay so this one takes a Text::sprintfn-compatible template and a hash holding the values for replacement in that template. π«Ά
and listen β three field names are reserved and get used as prefixes for messages if they're defined:
fileβ the name of a file πkeyβ the BibTeX key πfieldβ the BibTeX field name π·οΈ
also, the field suggestion is somewhat special too, because Text::BibTeX::Validate may use its value to replace the original in an attempt to clean up the BibTeX entry. she's a fixer. she's an icon. she's doing the work. π
π fields()
returns an array of the fields defined in the instance β in any order, so don't come for her about the order, bestie. π
π get( $field )
returns the value of a field. that's it. that's the method. simple, iconic, ate. β
π set( $field, $value )
sets a new value for a field. and then β plot twist β she returns the old value. π so rude but so useful.
π§ delete( $field )
unsets the value for a field. and yup, returns the old value too, because she would never leave you without closure. π
π to_string()
return a string representing the warning. literally just that. stringify slay. β¨
π AUTHORS π
- Andrius Merkys,
<merkys@cpan.org>π
π and that's the whole vibe check, bestie. every flag, every field, every method, nothing skipped, periodt. π¦
okay so this lil doc came from perl v5.32.1, dated 2021-02-28, and it lives in the User Contributed Perl Documentation family π mwah, go validate some BibTeX, you've got this π«Άβ¨π
π¦ where this page comes from
- debian bookworm: libtext-bibtex-validate-perl 0.3.0-1 Β· BSD-3-Clause
- debian trixie: libtext-bibtex-validate-perl 0.3.0-1 Β· BSD-3-Clause
- ubuntu jammy: libtext-bibtex-validate-perl 0.3.0-1 Β· BSD-3-Clause
- ubuntu noble: libtext-bibtex-validate-perl 0.3.0-1 Β· BSD-3-Clause
- ubuntu resolute: libtext-bibtex-validate-perl 0.3.0-1 Β· BSD-3-Clause
- ubuntu stonking: libtext-bibtex-validate-perl 0.3.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