Perl::...Keyword(3pm)
β¨ NAME β¨
okay bestie so this page is from the User Contributed Perl Documentation, and the module we're talking about is TooMuchCode::ProhibitUnnecessaryScalarKeyword β and what does it do? Finds scalar in scalar context. That's it. That's the whole job. π
π DESCRIPTION π
so this policy is very much giving "girl, why are you like this" energy, because it says that using scalar in a statement like this one? yeah, that needs to be removed:
my $n = scalar @items;
here's the tea β β if the left-hand side of the assignment is a single scalar variable, then the assignment is already in scalar context. like, it's already doing the thing. so there is no need to add the scalar keyword. you're just typing extra letters for no reason, bestie, and this policy will absolutely call you out on it. π«Ά
no cap. drop the scalar. it's giving unnecessary. periodt. β¨
anyway that's the whole vibe π this was Perl::...Keyword(3pm) from the User Contributed Perl Documentation, running on perl v5.36.0, dated 2023-10-05. love that for us. bye bestie, go delete some scalars π¦
π¦ where this page comes from
- debian trixie: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu noble: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu resolute: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- ubuntu stonking: libperl-critic-toomuchcode-perl 0.19-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms