Pandoc::Version(3pm)

πŸ“¦
version 0.9.2 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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 πŸ‘‘

  • version is a similar module for Perl version numbers.
  • SemVer extends versions to Semantic Versioning as described at <http://semver.org/>.
  • Pandoc::Release to 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