Perl Before Swine

Has that title been overdone yet? Oh well…

Here’s my Perl entry for today.

I run in to a ton of Perl code on some of my legacy server projects. A ton. And interestingly enough, two of my three favorite text editors don’t get it. BBEdit gets it of course. SubEthaEdit gets .pl and .pm files, but .cgi is oddly left out. Dreamweaver just shrugs.

To add Perl to Dreamweaver, get the Perl Support extension. Then (assuming you’re on v7.0.1 a.k.a. MX 2004) open ~/Library/Application Support/Macromedia/Dreamweaver MX 2004/Configuration/DocumentTypes/PerlDocumentTypes.xml and add cgi there in the winfileextension and macfileextension values. Quit and restart Dreamweaver and you’re set with .cgi editing in Dreamweaver along with .pl and .pm.

For SubEthaEdit, go to /Applications/SubEthaEdit.app/Contents/Resources/Modes/Perl.mode/Contents/ and edit info.plist to add cgi as an extension as shown here in context:

<array>
   <string>pl</string>
   <string>pm</string>
   <string>cgi</string>
</array>

And poof, .cgi files are colored purty.