I still use the expression style where possible. The recommendation in Perl Best Practices makes several arguments in favour of the block form, but I don't find them convincing:
- A block stands out more clearly.
- It probably does, but when the expression is simple enough, e.g. just /$pattern/, I don't see why a scope around it is needed.
- It avoids mistakes when a function in the expression eats the list as arguments.
- The mistake is either recognised by Perl itself, giving a compile-time error like Too many arguments for substr, or by a test.
- It saves you time when you later need to refactor the expression into something more complex.
- Adding a { and replacing a , with } doesn't take so much time. Also, many simple expressions stay simple.
Regarding refactoring for refactoring: I do it sometimes to my personal projects. It makes me more familiar with the code again, I touch parts I haven't seen for years, which means I can find and fix bugs faster when needed. Also, it makes me feel comfortable when reading the code or showing it to someone else. At work where the codebase is huge and changes must be supported by a ticket, I only refactor subs I need to touch for other reasons, and the refactor is always committed in a separate commit before the actual changes.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]