Perl::...trings(3pm)

πŸ’… NAME πŸ’…

So bestie, welcome to the manual page for Perl::Critic::Policy::ValuesAndExpressions::ProhibitVersionStrings, which lives in the User Contributed Perl Documentation section (3pm). The whole vibe of this policy in one line: don't use strings like "v1.4" or "1.4.5" when you're including other modules. Periodt. πŸ’–


🫢 AFFILIATION 🫢

Okay so this Policy is part of the core Perl::Critic distribution. It's canon, it ships with the main thing, iykyk. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

Whenever you use or require a module, you're allowed to specify a minimum version requirement. And listen β€” to keep things compatible with older Perls, that version number should be expressed as a floating-point number. Do not use v-strings, and do not use three-part numbers. Nope nope nope. πŸ™ˆ

The Perl convention for expressing version numbers as floats is literally this:

version + (patch level / 1000)

And here's how that actually looks, bestie:

use Foo v1.2    qw(foo bar);  # not ok
use Foo 1.2.03  qw(foo bar);  # not ok
use Foo 1.00203 qw(foo bar);  # ok

The first two? Not ok. Absolutely not. πŸ’€ The third one? Ok. That's the one. Slay. πŸ‘‘


πŸŽ€ CONFIGURATION πŸŽ€

Ngl, this Policy is not configurable β€” like, at all β€” except for the standard options. That's it. That's the whole customization menu. πŸ“


🧚 AUTHOR 🧚

Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> β€” the icon who wrote this. πŸ‘‘


Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. πŸ’œ

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. πŸŽ€


And that's the whole page, bestie! πŸ’– This absolute gem came to you courtesy of perl v5.42.0, dated 2024-10-23 β€” so go forth, write your version requirements as floats, and make the old Perls proud. Mwah! πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from