PBP: 070 Iterator Variables

December 29th, 2014

Mr. Conway suggests that you give explicit names for all for loops, and avoid the possibly confusing use of $_.  To this I say: Hallelujah! Read the rest of this entry »

PBP: 069 Necessary Subscripting

December 25th, 2014

In 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. Read the rest of this entry »

PBP: 068 Unnecessary Subscripting

December 22nd, 2014

The Best Practice suggests avoiding subscripting arrays or hashes within loops.  They have a good reason too! Read the rest of this entry »

PBP: 067 C-Style Loops

December 18th, 2014

The 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. Read the rest of this entry »

PBP: 066 Negative Control Statements

December 15th, 2014

The PBP simply states, “Don’t use unless or until at all.”  I don’t agree with the strength of that statement. Read the rest of this entry »

PBP: 065 Other Postfix Modifiers

December 15th, 2014

The PBP suggests one simple thing for using other postfix control structures, such as unless, for, while, and until.  It says: Don’t. Read the rest of this entry »

PBP: 064 Postfix Selectors

December 11th, 2014

Having 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. Read the rest of this entry »

PBP: 063 If Blocks

December 8th, 2014

The first entry in the “Control Structures” group regards the humble if statement.  Perl being perl, the if statement is more complex than it looks, and the Best Practices casually state, “… always use the block form of if.” Read the rest of this entry »

PBP: 062 Slice Factoring

December 4th, 2014

The Best Practices suggest extracting key or index lists out of large slices and using hashes to manage them. Read the rest of this entry »

PBP: 061 Slice Layout

December 2nd, 2014

Our favorite reference suggests that working with slices is easier when those items are aligned in columns.  Sometimes. Read the rest of this entry »