Projects

Or search support forum

What's Global Moxie?

Global Moxie is the hypertext laboratory of Josh Clark, a writer, programmer and designer whose projects include the Big Medium web content management system. Josh spins words and code from his multimedia studio in Paris, France.

What's Big Medium?

Big Medium is flexible, easy-to-use server software for creating and editing websites directly from your browser. Check out the features or download now.

On Shelves

Cover: Best iPhone Apps

Best iPhone Apps is my guide to more than 200 gee-whiz apps to unlock the full potential of your favorite gadget. Order yours now.

iWork ’09: The Missing Manual

iWork ’09: The Missing Manual is my fun and comprehensive book about Apple’s remarkable word processor, presentation software, and spreadsheet program.
Order yours now.

Moxiemail

Enter your e-mail to receive occasional updates:

Perl Critic for BBEdit

Perl Critic for BBEdit is a free script plugin for the BBEdit text editor to enable Perl programmers to check their code format against the style guidelines of the Perl Best Practices book by Damian Conway. A nifty tool to help keep your code tidy. Free.

Perl Critic for BBEdit 1.1 (19 KB)
Download Perl Critic for BBEdit.

Updated July 27, 2009: Version 1.1 adds a compatibility fix for Perl::Critic version 1.094 and later.

Screenshot - Perl Critic
Perl Critic warnings are displayed in BBEdit's results browser.

Perl Critic for BBEdit is a free AppleScript plugin for the BBEdit text editor that lets Perl programmers check their code against the style recommendations of Damian Conway's book, Perl Best Practices. Warnings are displayed in the results browser just like BBEdit's built-in Perl and HTML syntax checkers.

Perl Critic for BBEdit requires Mac OS X 10.3.9 or later. It's been tested against BBEdit 8.2.6, 8.5, and 9.2.1. The Perl::Critic module must be installed.

These scripts are free and are released under a Creative Commons Attribution-ShareAlike License.

Credit All 'Round

Perl Critic for BBEdit owes its existence to three people, whose works I can't recommend enough.

Jeffrey Ryan Thalhammer is creator of the Perl::Critic module, which Perl Critic for BBEdit relies upon for all the dirty work. Perl::Critic analyzes Perl code for compliance with style and syntax rules. Most of these rules are based on the recommendations of the Perl Best Practices book, but the system is not especially dogmatic. You can customize the ruleset so that it enforces just the style rules that fit your particular preferences or house style guide.

Damian Conway is a pillar of the Perl community and author of the Perl Best Practices book, which has become a kind of defacto style guide for the Perl language and a surprisingly good read to boot.

John Gruber wrote the excellent CSS Syntax Checker for BBEdit and TextWrangler, which inspired Perl Critic for BBEdit. Much of the code is shamelessly swiped from Gruber.

Installation

Perl Critic for BBEdit consists of two script files, one AppleScript and one Perl:

  • Perl Critic.scpt
  • Perl Critic.pl

(A third file named perlcriticrc is also enclosed, more on that in a sec.)

Put both scripts in your BBEdit scripts folder:

~/Library/Application Support/BBEdit/Scripts/

Be a Critic

Screenshot - Perl Critic Menu

Open a Perl script in BBedit and choose "Perl Critic" from the Scripts menu. It will probably take a second or two to run, but can take several seconds for longer scripts or those that have a large number of warnings.

Any Perl Critics warnings will appear in a results browser, along with references to the Perl Best Practices page numbers that describe the problem, if applicable. Double clicking the item in the results browser takes you to the line of code that presents the problem.

Customize the Critic

The Perl::Critic module allows you to customize the rules to be enforced by adding a configuration file to your home directory (/Users/yourname). The details are described in the Perl::Critic documentation. The configuration file lets you name a style rule and then set the severity of that rule on a scale of 1 to 5, with 5 being most important.

The included file perlcriticrc is a sample configuration file. Edit it as you see fit, put it in your home directory, and rename it as .perlcriticrc (i.e., precede the name with a dot).

By default, Perl Critic for BBedit flags any rule violation with a severity of 2 or more. You can change this by editing the Perl Critic.pl file:

# severity is a number from 1 to 5 that determines what level of warnings to
# report; the lower the value, the more strict the warnings and, probably,
# the more warnings you'll receive
my $SEVERITY = 2;

Tags: , ,

Download Big Medium
Try it free for 30 days, or buy to unlock.

Above and Beyond

"Big Medium is an awesome product! I don't know how I survived without it for so many years. Your support goes above and beyond anything I've experienced using any other software package."
—Leroy G. Blimegger Jr.

"I love Big Medium 2... It's the most powerful news/article/content manager I have seen for my type of sites in years."
—Don McP

"Congrats on a job well done with Big Medium 2. This is by far the most amazing software anyone can buy for under $10,000."
—Steve Carter, Hometown Times

More praise for Big Medium