Perl::...atives(3pm)
β¨ NAME β¨
Perl::Critic::Policy::Community::PreferredAlternatives β bestie, it's the policy that clocks when you're using a module when the community has a glow-up replacement waiting for you π¦
(also it lives in the Perl::...atives(3pm) page, per the manual name, iykyk)
π DESCRIPTION π
So here's the tea, bestie: some modules out there have alternatives that certain slices of the community prefer, for a whole bunch of reasons β think buggy behavior, straight-up cruft, performance problems, maintainer drama, or honestly just better modern replacements that ate π
This policy is a low severity complement to Perl::Critic::Policy::Community::DiscouragedModules. Lowkey the chill sibling. Still clocking you though. π
π MODULES π
π Getopt::Std
Getopt::Std was the original very simplistic command-line option processing module. Iconic for its time, but it is now obsoleted by the much more complete solution Getopt::Long, which also supports short options β and which is wrapped by modules such as Getopt::Long::Descriptive and Getopt::Long::Modern for simpler usage. Upgrade your whole vibe, fr fr. β¨
πΈ JSON
JSON.pm is old and full of slow logic. No cap. Use JSON::MaybeXS instead β it's a drop-in replacement in most cases, so like, there's literally no excuse. π
π¦ List::MoreUtils
List::MoreUtils is a far more complex distribution than it needs to be. Main character energy that nobody asked for, honestly. Use List::SomeUtils instead, or peek at List::Util or List::UtilsBy for alternatives. π§
π Mouse
Mouse was created to be a faster version of Moose, but that niche has since been better filled by Moo. So... use Moo instead. The way that Moose-lore evolved and Mouse got left on read π
π₯ Readonly
Readonly.pm is buggy and slow. Use Const::Fast or ReadonlyX instead, or the core pragma constant. Three options bestie, pick one, slay. π
π AFFILIATION π
This policy is part of Perl::Critic::Community. π«Ά
β CONFIGURATION β
Occasionally you may find yourself needing to use one of these non-preferred modules, and you do not want the warnings. Totally valid, bestie, sometimes the old thing is the thing. You can do so by putting something like the following in a .perlcriticrc file like this:
[Community::PreferredAlternatives]
allowed_modules = Getopt::Std JSON
The same option is offered for Perl::Critic::Policy::Community::DiscouragedModules. π
π AUTHOR π
Dan Book, "dbook@cpan.org" β legend behavior, we love to see it π
π COPYRIGHT AND LICENSE π
Copyright 2015, Dan Book.
This library is free software; you may redistribute it and/or modify it under the terms of the Artistic License version 2.0. πΈ
π¦ SEE ALSO π¦
Perl::Critic
okay that's the whole page bestie, go forth and use the preferred alternatives β¨
this was Perl::...atives(3pm) from the User Contributed Perl Documentation, running on perl v5.40.1, dated 2025-03-22 β mwah, periodt π
π
π¦ where this page comes from
- debian trixie: libperl-critic-community-perl 1.0.4-1 Β· Artistic-2.0
- ubuntu resolute: libperl-critic-community-perl 1.0.4-1 Β· Artistic-2.0
- ubuntu stonking: libperl-critic-community-perl 1.0.4-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms