Archive for the ‘Perl’ Category

PBP: 068 Unnecessary Subscripting

Monday, December 22nd, 2014

The 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, 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. (more…)

PBP: 066 Negative Control Statements

Monday, 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. (more…)

PBP: 065 Other Postfix Modifiers

Monday, 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. (more…)

PBP: 064 Postfix Selectors

Thursday, 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. (more…)

PBP: 063 If Blocks

Monday, 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.” (more…)

PBP: 062 Slice Factoring

Thursday, December 4th, 2014

The Best Practices suggest extracting key or index lists out of large slices and using hashes to manage them. (more…)

PBP: 061 Slice Layout

Tuesday, December 2nd, 2014

Our favorite reference suggests that working with slices is easier when those items are aligned in columns.  Sometimes. (more…)

PBP: 060 Slicing

Monday, November 24th, 2014

Everyone’s favorite set of Perl guideliens tells is not to forget about the awesome power of array slices!  That’s smart, too. (more…)

PBP: 059 Array Indices

Thursday, November 20th, 2014

The PBP reminds us that we can use negative indexes to access arrays in reverse, instead of having to do calculations for it.  It suggests several useful reasons, including readability and getting the interpreter to complain in some cases instead of silently doing the wrong thing.  I don’t feel that strongly about this suggestion, but do follow it. (more…)