in reply to
Re^2: How to write better code?
in thread How to write better code?
Your implementation using map instead of foreach is slightly more readable, but will be more cumbersome to maintain and debug if additional parsing is required. It is likely a short-term win that will result in a comment block that is larger than the code after a few upgrades are made.
Another weakness of using map for this is that CGI allows a parameter to have multiple values, but the code you provided will only use the last value.