Pandoc::Version(3pm)
π Pandoc::Version(3pm) β the vibe-coded guide π
okay bestie, welcome to Pandoc::Version(3pm) from the User Contributed Perl Documentation section. this is the little module that keeps track of version numbers, and honestly? she's doing the most with the least. let's get into it β¨
πΈ NAME πΈ
Pandoc::Version β version number of pandoc and its libraries π
β¨ SYNOPSIS β¨
$version = Pandoc::Version->new("1.17.2"); # create version
$version = bless [1,17,2], 'Pandoc::Version'; # equivalent
"$version"; # stringify to "1.17.2"
$version > 1.9; # compare
$version->[0]; # major
$version->[1]; # minor
$version->match('1.17'); # true for 1.17, 1.17.x, 1.17.x.y...
like. look at her. four lines and she's already comparing, stringifying, and matching. main character energy fr fr π
π¦ DESCRIPTION π¦
so basically, this module stores and compares version numbers of the pandoc executable and the Haskell libraries compiled into pandoc. a Pandoc::Version object is literally just an array reference of one or more non-negative integer values. that's it. that's the whole girl π
and here's the part where you can breathe: in most cases you do not need to create Pandoc::Version objects by hand. like, at all. just use the instances returned by the methods version and libs of module Pandoc and trust in overloading π«Ά she's got you.
π METHODS π
π string
return a string representation of a version, for instance "1.17.0.4". this method is automatically called by overloading in string context β so you don't even have to ask, she just shows up π
π number
return a number representation of a version, for instance 1.017000004. also automatically called by overloading, this time in number context. lowkey unhinged of her but we love it π₯
π cmp( $version )
compare two version numbers. this method is used automatically by overloading to compare version objects with strings or numbers, using the operators eq, lt, le, ge, ==, <, >, <=, and >=. so you can just throw comparisons around and she'll handle it, no cap π§
π match( $version )
return whether a version number matches another version number if cut to the same number of parts. for instance 1.2.3 matches 1, 1.2, and 1.2.3. it's giving "close enough bestie" but in a mathematically rigorous way π
π fulfills( $version_requirement )
return whether a version number fullfills a version requirement, such as "!=1.16, <=1.17". for the possible values, go peep "Version Ranges" in CPAN::Meta::Spec. yes she's fancy like that π
π TO_JSON
return an array reference of the version number so it can be serialized in JSON format. json girlies stay winning β¨
π SEE ALSO π
versionis a similar module for Perl version numbers.SemVerextends versions to Semantic Versioning as described at <http://semver.org/>.Pandoc::Releaseto get information about and download pandoc releases.
ngl, that's the whole page. tiny module, big slay ππ
and that's a wrap, bestie!! this masterpiece shipped as perl v5.38.2, dated 2024-08-03, filed under Pandoc::Version(3pm). go forth and compare versions responsibly π«ΆπΈπ
π¦ where this page comes from
- debian trixie: libpandoc-wrapper-perl 0.9.2-1 Β· EUPL-1.2
- ubuntu resolute: libpandoc-wrapper-perl 0.9.2-1 Β· EUPL-1.2
- ubuntu stonking: libpandoc-wrapper-perl 0.9.2-1 Β· EUPL-1.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms