in reply to Re^5: use constant for strings (unary plus)
in thread use constant for strings
Intriquing. The very best savings I could achieve using map $_, list over map{ $_ } list; was under 1%. And I thought I was the clown of micro-optimisations:)
The number of chars is identical, and even comparing the dumps using perl -MO:Bblock... show only minimal differences.
I tend to stick with the block form as it allows me to insert additional statements (like print;) into the block without having to change the syntax which I find especially useful when debugging pipelined maps, grep's and sorts--as used in the ST.
Personally, I find it visually clearer too. TIMTOWTDI:) YMMV... etc. etc.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: use constant for strings (unary plus)
by Aristotle (Chancellor) on Apr 19, 2003 at 13:40 UTC |