Starting from Perl 5.8.1 map in void context is not expensive:
map in void context is no longer
expensive. map is now context aware,
and will not construct a list if
called in void context.
But the postfix form of for
may be more readable:
perform_action($_) for @items;
More Related Contents:
- How can I combine hashes in Perl?
- If condition based look up not working [closed]
- Convert Bash script to Perl/VBS/any other windows compatible language [closed]
- Redirecting the perl script
- How can I troubleshoot my Perl CGI script?
- How is Perl’s @INC constructed? (aka What are all the ways of affecting where Perl modules are searched for?)
- How can I install Perl modules without root privileges?
- How do I compare two strings in Perl?
- What is the difference between ‘my’ and ‘our’ in Perl?
- Difference between &function and function() in perl [duplicate]
- Perl flags -pe, -pi, -p, -w, -d, -i, -t?
- How do you round a floating point number in Perl?
- Why do I have to specify the -i switch with a backup extension when using ActivePerl?
- How can I run Perl system commands in the background?
- Why is this program valid? I was trying to create a syntax error
- Find size of an array in Perl
- How does Perl parse unquoted bare words?
- Perl build, unit testing, code coverage: A complete working example
- What does the -> arrow do in Perl?
- What’s the difference between iterating over a file with foreach or while in Perl?
- What’s the differences between system and backticks and pipes in Perl?
- How to ignore ‘Certificate Verify Failed’ error in perl?
- How do I make Perl scripts recognize command-line parameters in the Win32 cmd console?
- What is the meaning of @_ in Perl?
- What should I use for a Perl script’s shebang line?
- How do I list available methods on a given object or package in Perl?
- How can I find memory leaks in long-running Perl program?
- How can I calculate the number of days between two dates in Perl?
- How can I treat command-line arguments as UTF-8 in Perl?
- Why doesn’t Perl’s each() iterate through the entire hash the second time?