Perl::C...Require(3)
π Perl::C...Require(3) π
okay bestie, this page comes from User Contributed Perl Documentation, and it's for Perl::C...Require(3). Buckle up π«Ά
πΈ NAME πΈ
Perl::Critic::Policy::Lax::ProhibitStringyEval::ExceptForRequire β stringy eval is bad, but it's okay just to require π
π VERSION π
version 0.014 β¨
β¨ DESCRIPTION β¨
okay so literally everybody sane agrees that stringy eval is usually a bad thing, but sometimes you need it, and you do not want to have to stick a no critic on the end, because dangit, what you are doing is just not wrong! π€
See, require is busted. You can't pass it a variable containing the name of a module and have it look through @INC. That has lead to this common idiom:
eval qq{ require $module } or die $@;
This policy acts just like BuiltinFunctions::ProhibitStringyEval, but makes an exception when the content of the string is PPI-parseable Perl that looks something like this:
require $module
require $module[2];
use $module (); 1;
Then again, maybe you should use Module::Runtime. π€
π¦ PERL VERSION π¦
This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. π«Ά
Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. π«‘
π AUTHOR π
Ricardo Signes <cpan@semiotic.systems> π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2022 by Ricardo Signes <cpan@semiotic.systems>. π
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. π
xoxo, this page was served fresh from perl v5.40.0, dated 2023-01-01, for Perl::C...Require(3) β slay and read the docs π
π
π¦ where this page comes from
- epel 10: perl-Perl-Critic-Lax 0.014-1.el10_0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms