The Best Practice is to use grep and first instead of for to refine or search lists. Again, there are good reasons, but I find it difficult, and am only improving with deliberate practice. (more…)
Author Archive
PBP: 073 List Selections
Thursday, January 8th, 2015PBP: 072 List Generation
Monday, January 5th, 2015The Best Practice is to use map when generating a new list from an old one. The reasoning is good, but I struggle with it anyway. I’m getting better with effort. (more…)
PBP: 071 Non-Lexical Loop Iterators
Thursday, January 1st, 2015The statement made by this Best Practice is simple, “Always declare a for loop iterator with my.” The reasoning behind it is complex, and surprised me. I am sure I have screwed this up in the past, too. It’s important as there’s a real gotcha here! (more…)
PBP: 070 Iterator Variables
Monday, December 29th, 2014Mr. Conway suggests that you give explicit names for all for loops, and avoid the possibly confusing use of $_. To this I say: Hallelujah! (more…)
PBP: 069 Necessary Subscripting
Thursday, December 25th, 2014In those places you do actually need both the key and value, you will have to go ahead and do the lookup on the key to get the value. The PBP reminds us to only do that once, instead of many times in the loop. (more…)
PBP: 068 Unnecessary Subscripting
Monday, December 22nd, 2014The Best Practice suggests avoiding subscripting arrays or hashes within loops. They have a good reason too! (more…)
PBP: 067 C-Style Loops
Thursday, December 18th, 2014The Best Practices cast the use of C Style For Loops out of our lexicon. Personally, I don’t get why this is, but haven’t needed them in a while. (more…)
PBP: 066 Negative Control Statements
Monday, December 15th, 2014The PBP simply states, “Don’t use unless or until at all.” I don’t agree with the strength of that statement. (more…)
PBP: 065 Other Postfix Modifiers
Monday, December 15th, 2014The PBP suggests one simple thing for using other postfix control structures, such as unless, for, while, and until. It says: Don’t. (more…)
PBP: 064 Postfix Selectors
Thursday, December 11th, 2014Having given a concrete statement of “… always use the block form of if.” the PBP then gives you a time and place to use a postix if. It says that’s okay if you’re it for using a flow control statement like next, return, last, etc. (more…)