Index: Commands/Run Perlcritic.tmCommand
===================================================================
--- Commands/Run Perlcritic.tmCommand	(revision 0)
+++ Commands/Run Perlcritic.tmCommand	(revision 0)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>beforeRunningCommand</key>
+	<string>nop</string>
+	<key>command</key>
+	<string>#!/usr/bin/env ruby
+# Run Perl::Critic on the current file.
+ 
+require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor"
+require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document"
+
+def colorize_critic_output(str)
+  styles = {5 =&gt; "Red", 4 =&gt; "GoldenRod", 3 =&gt; "DodgerBlue" }
+  styles.default = ""
+  str.map do |line|
+    file, line_no, col_no, message, ref, severity = line.split(':')
+    "&amp;bull; &lt;span class=\"out\" style=\"color:#{styles[severity.to_i]};\";&gt;(Severity: #{severity.to_i})&lt;/span&gt; #{message} &lt;a href=\"txmt://open?line=#{line_no}&amp;amp;column=#{col_no}#{file}\"&gt;at line #{line_no}, column #{col_no}&lt;/a&gt;. #{ref}.&lt;br/&gt;"
+  end
+end
+
+TextMate.save_current_document
+TextMate::Executor.run(ENV["TM_PERLCRITIC"] || "perlcritic", 
+    '--verbose', '%f:%l:%c:%m:%e:%s\n',  
+    ENV['TM_PERLCRITIC_LEVEL'] || '--stern', 
+    '--nocolor', ENV["TM_FILEPATH"], 
+    :use_hashbang=&gt;false, :verb =&gt; "Criticising") do |str, type|
+  case type
+  when :err
+    # do special transformation of stderr
+    "&lt;span class=\"err\"&gt;#{htmlize(str)}&lt;/span&gt;"
+  when :out
+    # special transformation of stdout 
+    colorize_critic_output(str)
+  end
+end
+</string>
+	<key>input</key>
+	<string>document</string>
+	<key>keyEquivalent</key>
+	<string>@C</string>
+	<key>name</key>
+	<string>Run Perlcritic</string>
+	<key>output</key>
+	<string>showAsHTML</string>
+	<key>scope</key>
+	<string>source.perl</string>
+	<key>uuid</key>
+	<string>D8F21943-DB91-40B4-9A2F-7A4DB03542C2</string>
+</dict>
+</plist>
