We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description
It would be very helpful if a warning were issued when the => operator is used in the map EXPR,LIST syntax, in order to avoid writing this code:
=>
map EXPR,LIST
map $_ => false, @subplot
which is definitely not the same as
map { $_ => false} @subplot
which is what I really meant.
The text was updated successfully, but these errors were encountered:
People like you also enjoyed: Perl::Critic::Policy::BuiltinFunctions::RequireBlockMap
Sorry, something went wrong.
Not as much as I enjoy block-less map!
Block-less map fans like us must learn the subtle differences between the lists returned by these:
map $_ => false , @subplot # false, @subplot map { $_ => false } @subplot # @subplot elements alternating with false map +( $_ => false ), @subplot # @subplot elements alternating with false map +{ $_ => false }, @subplot # hashrefs with key = a @subplot item, value = false map { $_ => false }, @subplot # syntax error
Even though I love the expression form for its conciseness, I'll readily admit the block form is the safe and consistent one.
No branches or pull requests
Description
It would be very helpful if a warning were issued when the
=>
operator is used in themap EXPR,LIST
syntax, in order to avoid writing this code:map $_ => false, @subplot
which is definitely not the same as
map { $_ => false} @subplot
which is what I really meant.
The text was updated successfully, but these errors were encountered: