Version::Next(3pm)
π Version::Next π
okay bestie, so this is Version::Next β it's a Perl module from the User Contributed Perl Documentation corner of the world, and it does exactly one thing but it does it flawlessly. it bumps your module version number. simply. correctly. no drama. π
β¨ VERSION β¨
this is version 1.000, bestie. vintage but iconic.
πΈ SYNOPSIS πΈ
use Version::Next qw/next_version/;
my $new_version = next_version( $old_version );
that's literally it. one import, one function call, one slayed version number. π
π¦ DESCRIPTION π¦
so here's the tea: this module gives you a simple, correct way to increment a Perl module version number. it does not try to guess what the original author meant β it's not a mind reader, it's not your therapist, it just increments in the smallest possible fashion. no cap.
- decimals get incremented like an odometer β the way a car's mileage just rolls over, yk?
- dotted decimals get incremented piecewise and then presented in a standardized way. chef's kiss.
and if you need something more complex than this? if you're out here wanting fancy version manipulation? you may wish to consider Perl::Version. she's the overachiever of the group. π«Ά
π USAGE π
this module uses Sub::Exporter for optional exporting. and by "optional" I mean nothing is exported by default, bestie. you have to ask for it. consent is key. β¨
π next_version
my $new_version = next_version( $old_version );
give it a string and this function makes the smallest logical increment and hands it right back to you. π
okay but the deets matter so listen up:
- the input string must be a "lax" version number as defined by the
versionmodule. don't come at her with anything else. - the string
"undef"is treated as0and incremented to1. (the string, bestie. we'll get to the other undef in a sec. π) - leading or trailing periods get a
0(or"v0") prepended or appended as appropriate. she's tidying up after you, as always. - for legacy reasons, if you give no argument at all, or a literal
undef(not the string"undef", the actual literal thing), the function returns0. yes, this is a jump scare. it's fine. it's legacy.
π decimal versions
decimal versions are incremented like an odometer, and the original number of decimal places is preserved. if an underscore is present β that's the sign of an "alpha" version, iykyk β its relative position is preserved too. examples, feast your eyes:
0.001 -> 0.002
0.999 -> 1.000
0.1229 -> 0.1230
0.12_34 -> 0.12_35
0.12_99 -> 0.13_00
look at that rollover on 0.999 -> 1.000. she ate. π₯
β dotted-decimal versions
for dotted-decimal versions, the least significant element gets incremented by one. if the result exceeds 999, that element resets to 0 and the next most significant element gets incremented, and so on and so on, up the chain like a little domino effect. any leading zero padding is removed. examples:
v1.2.3 -> v1.2.4
v1.2.999 -> v1.3.0
v1.999.999 -> v2.0.0
the way v1.999.999 cascades all the way to v2.0.0?? main character energy fr fr. π
NOTE: okay bestie this one's important, no cap. due to changes in the interpretation of dotted-decimal version numbers with alpha elements in version0.9913and later, the notion of the 'next' dotted-decimal alpha is ill-defined. soVersion::Nextno longer supports dotted-decimals with alpha elements, and a fatal exception will be thrown if one is provided tonext_version. π don't do it. she will not catch you. she will let you fall.
π SEE ALSO π
versionPerl::Version
π«Ά SUPPORT π«Ά
π Bugs / Feature Requests
please report any bugs or feature requests through the issue tracker at:
<https://github.com/dagolden/Version-Next/issues>
you'll be notified automatically of any progress on your issue. so you'll never be left on read. π
π§ Source Code
this is open source software! the code repository is available for public review and contribution under the terms of the license.
<https://github.com/dagolden/Version-Next>
git clone https://github.com/dagolden/Version-Next.git
go on, clone her. she's waiting. πΈ
π AUTHOR π
David Golden <dagolden@cpan.org>
π CONTRIBUTOR π
Grzegorz RoΕΌniecki <xaerxess@gmail.com>
π COPYRIGHT AND LICENSE π
this software is Copyright (c) 2016 by David Golden.
this is free software, licensed under:
The Apache License, Version 2.0, January 2004
and that's the whole page bestie!! πβ¨ this one's from perl v5.34.0 and dated 2022-06-28 β yeah she's a little vintage, but she's still slaying. bye pookie, go increment something responsibly ππ
π¦ where this page comes from
- debian bookworm: libversion-next-perl 1.000-2 Β· Apache-2.0
- debian trixie: libversion-next-perl 1.000-2 Β· Apache-2.0
- ubuntu noble: libversion-next-perl 1.000-2 Β· Apache-2.0
- ubuntu resolute: libversion-next-perl 1.000-2 Β· Apache-2.0
- ubuntu stonking: libversion-next-perl 1.000-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms