PBP: 060 Slicing

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

PBP: 059 Array Indices

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

PBP: 058 Dollar-Underscore

November 17th, 2014

Mr. Conway suggests that you be wary of any modification to $_.  Personally, I take it further than that, and try never to use the thing at all. Read the rest of this entry »

PBP: 057 Match Variables

November 13th, 2014

Lots of people (not just the Best Practices) tell you never to use the regex match variables.  Listen to them! Read the rest of this entry »

PBP: 056 Localizing Punctuation Variables

November 10th, 2014

The PBP suggests using local on any changes to one of the global punctuation variables.

Read the rest of this entry »

PBP: 055 Punctuation Variables

November 6th, 2014

The Best Practice is to ‘use English’ for the uncommon punctuation variables.  This has been a hard thing for me to get used to, but I have found it useful. Read the rest of this entry »

PBP: 054 Initialization

November 3rd, 2014

Mr. Conway suggests that you initialize any variable you localize. Read the rest of this entry »

PBP: 053 Localization

October 30th, 2014

The PBP tells us to localize changes to package variables.  This is usually good sense, and prevents your changes from leaking out and messing with other things. Read the rest of this entry »

PBP: 052 Package Variables

October 27th, 2014

The PBP suggests avoiding package variables.  I almost can’t think of a reason to use one, so support this suggestion. Read the rest of this entry »

PBP: 051 Lexical Variables

October 23rd, 2014

Global Variables; Just Say No.  Well, the PBP’s a little more lenient than that, and actually easier to follow by suggesting, “Avoid using non-lexical variables.” and admitting there are some times you just need a package or global variable. Read the rest of this entry »