Perl::...atives(3pm)

πŸ“¦
version 1.0.4 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ 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 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