The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Perl::Critic::Policy::Freenode::DiscouragedModules - Various modules discouraged from use

DESCRIPTION

Various modules are discouraged by the denizens of #perl on Freenode IRC, for various reasons which may include: buggy behavior, cruft, maintainer issues, or simply better modern replacements.

MODULES

AnyEvent

AnyEvent's author refuses to use public bugtracking and actively breaks interoperability. POE, IO::Async, and Mojo::IOLoop are widely used and interoperable async event loops.

Any::Moose

Any::Moose is deprecated. Use Moo instead.

Class::DBI

Class::DBI is an ancient database ORM abstraction layer which is buggy and abandoned. See DBIx::Class for a more modern DBI-based ORM, or Mad::Mapper for a Mojolicious-style ORM.

CGI

CGI.pm is an ancient module for communicating via the CGI protocol, with tons of bad practices and cruft. Use a modern framework such as those based on Plack (Web::Simple, Dancer2, Catalyst) or Mojolicious, they can still be served via CGI if you choose.

Coro

Coro no longer works on perl 5.22, you need to use the author's forked version of Perl. Avoid at all costs.

Error

Error.pm is overly magical and discouraged by its maintainers. Try Throwable for exception classes in Moo/Moose, or Exception::Class otherwise. Try::Tiny or Try are recommended for the try/catch syntax.

File::Slurp

File::Slurp gets file encodings all wrong, line endings on win32 are messed up, and it was written before layers were properly added. Use File::Slurper, "slurp" in Path::Tiny, "slurp" in Data::Munge, or "slurp" in Mojo::File.

Getopt::Std

Getopt::Std was the original very simplistic command-line option processing module. It is now obsoleted by the much more complete solution Getopt::Long, which also supports short options, and is wrapped by modules such as Getopt::Long::Descriptive and Getopt::Long::Modern for simpler usage.

HTML::Template

HTML::Template is an old and buggy module, try Template::Toolkit, HTML::Zoom, or Text::Template instead, or HTML::Template::Pro if you must use the same syntax.

IO::Socket::INET6

IO::Socket::INET6 is an old attempt at an IPv6 compatible version of IO::Socket::INET, but has numerous issues and is discouraged by the maintainer in favor of IO::Socket::IP, which transparently creates IPv4 and IPv6 sockets.

JSON

JSON.pm is old and full of slow logic. Use JSON::MaybeXS instead, it is a drop-in replacement in most cases.

JSON::Any

JSON::Any is deprecated. Use JSON::MaybeXS instead.

JSON::XS

JSON::XS's author refuses to use public bugtracking and actively breaks interoperability. Cpanel::JSON::XS is a fork with several bugfixes and a more collaborative maintainer. See also JSON::MaybeXS.

List::MoreUtils

List::MoreUtils is a far more complex distribution than it needs to be. Use List::SomeUtils instead, or see List::Util or List::UtilsBy for alternatives.

Mouse

Mouse was created to be a faster version of Moose, a niche that has since been better filled by Moo. Use Moo instead.

Net::IRC

Net::IRC is an ancient module implementing the IRC protocol. Use a modern event-loop-based module instead. Choices are POE::Component::IRC (used for Bot::BasicBot), Net::Async::IRC, and Mojo::IRC.

Readonly

Readonly.pm is buggy and slow. Use Const::Fast or ReadonlyX instead, or the core pragma constant.

Switch

Switch.pm is a buggy and outdated source filter which can cause any number of strange errors, in addition to the problems with smart-matching shared by its replacement, "The 'switch' feature" in feature (given/when). Try Switch::Plain instead.

XML::Simple

XML::Simple tries to coerce complex XML documents into perl data structures. This leads to overcomplicated structures and unexpected behavior. Use a proper DOM parser instead like XML::LibXML, XML::TreeBuilder, XML::Twig, or Mojo::DOM.

AFFILIATION

This policy is part of Perl::Critic::Freenode.

CONFIGURATION

This policy is not configurable except for the standard options.

AUTHOR

Dan Book, dbook@cpan.org

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