PBP: 045 Barewords

Perl supports “barewords”, which are strings that just sit naked in your program.  If it isn’t parsable code, it’s a bareword.  The PBP says: Don’t.  I agree, as does ‘use strict’, which I always use.

I don’t have too much additional to say here.  Mr. Conway goes into great detail about the ways in which barewords are scary and why they should be avoided.  They’re too likely to do the wrong thing based on changes elsewhere in the program, and do not lead to good development habits or maintainable software.

use strict, and don’t ever worry about many of those issues.

Leave a Reply