Index: Commands/PerlCritic (Harsh).tmCommand
===================================================================
--- Commands/PerlCritic (Harsh).tmCommand	(revision 0)
+++ Commands/PerlCritic (Harsh).tmCommand	(revision 0)
@@ -0,0 +1,23 @@
+<?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>export TM_RUBY=$(type -p "${TM_RUBY:-ruby}")
+"${TM_RUBY}" -- "$TM_BUNDLE_SUPPORT/PerlCritic/perlcritic.rb" --harsh</string>
+	<key>input</key>
+	<string>document</string>
+	<key>keyEquivalent</key>
+	<string>^@3</string>
+	<key>name</key>
+	<string>PerlCritic (Harsh)</string>
+	<key>output</key>
+	<string>showAsHTML</string>
+	<key>scope</key>
+	<string>source.perl</string>
+	<key>uuid</key>
+	<string>29B537A2-3ED8-4862-A0BE-D6EBCD734CDF</string>
+</dict>
+</plist>
Index: Commands/PerlCritic (Brutal).tmCommand
===================================================================
--- Commands/PerlCritic (Brutal).tmCommand	(revision 0)
+++ Commands/PerlCritic (Brutal).tmCommand	(revision 0)
@@ -0,0 +1,23 @@
+<?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>export TM_RUBY=$(type -p "${TM_RUBY:-ruby}")
+"${TM_RUBY}" -- "$TM_BUNDLE_SUPPORT/PerlCritic/perlcritic.rb" --brutal</string>
+	<key>input</key>
+	<string>document</string>
+	<key>keyEquivalent</key>
+	<string>^@1</string>
+	<key>name</key>
+	<string>PerlCritic (Brutal)</string>
+	<key>output</key>
+	<string>showAsHTML</string>
+	<key>scope</key>
+	<string>source.perl</string>
+	<key>uuid</key>
+	<string>E88EB72E-9CBC-45ED-9C74-BFF2ADAFF408</string>
+</dict>
+</plist>
Index: Commands/PerlCritic (Cruel).tmCommand
===================================================================
--- Commands/PerlCritic (Cruel).tmCommand	(revision 0)
+++ Commands/PerlCritic (Cruel).tmCommand	(revision 0)
@@ -0,0 +1,23 @@
+<?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>export TM_RUBY=$(type -p "${TM_RUBY:-ruby}")
+"${TM_RUBY}" -- "$TM_BUNDLE_SUPPORT/PerlCritic/perlcritic.rb" --cruel</string>
+	<key>input</key>
+	<string>document</string>
+	<key>keyEquivalent</key>
+	<string>^@4</string>
+	<key>name</key>
+	<string>PerlCritic (Cruel)</string>
+	<key>output</key>
+	<string>showAsHTML</string>
+	<key>scope</key>
+	<string>source.perl</string>
+	<key>uuid</key>
+	<string>93F831D4-E880-481A-98CC-23EF3D057CA1</string>
+</dict>
+</plist>
Index: Commands/PerlCritic (Stern).tmCommand
===================================================================
--- Commands/PerlCritic (Stern).tmCommand	(revision 0)
+++ Commands/PerlCritic (Stern).tmCommand	(revision 0)
@@ -0,0 +1,23 @@
+<?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>export TM_RUBY=$(type -p "${TM_RUBY:-ruby}")
+"${TM_RUBY}" -- "$TM_BUNDLE_SUPPORT/PerlCritic/perlcritic.rb" --stern</string>
+	<key>input</key>
+	<string>document</string>
+	<key>keyEquivalent</key>
+	<string>^@2</string>
+	<key>name</key>
+	<string>PerlCritic (Stern)</string>
+	<key>output</key>
+	<string>showAsHTML</string>
+	<key>scope</key>
+	<string>source.perl</string>
+	<key>uuid</key>
+	<string>C19FD4CB-4D6A-4193-A701-CFD2E3A9142B</string>
+</dict>
+</plist>
Index: Commands/PerlCritic (Gentle).tmCommand
===================================================================
--- Commands/PerlCritic (Gentle).tmCommand	(revision 0)
+++ Commands/PerlCritic (Gentle).tmCommand	(revision 0)
@@ -0,0 +1,23 @@
+<?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>export TM_RUBY=$(type -p "${TM_RUBY:-ruby}")
+"${TM_RUBY}" -- "$TM_BUNDLE_SUPPORT/PerlCritic/perlcritic.rb" --gentle</string>
+	<key>input</key>
+	<string>document</string>
+	<key>keyEquivalent</key>
+	<string>^@5</string>
+	<key>name</key>
+	<string>PerlCritic (Gentle)</string>
+	<key>output</key>
+	<string>showAsHTML</string>
+	<key>scope</key>
+	<string>source.perl</string>
+	<key>uuid</key>
+	<string>D511D84B-0CAF-4769-8BA7-6F509E0DA931</string>
+</dict>
+</plist>
Index: Commands/Perlcritic.tmCommand
===================================================================
--- Commands/Perlcritic.tmCommand	(revision 0)
+++ Commands/Perlcritic.tmCommand	(revision 0)
@@ -0,0 +1,23 @@
+<?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>export TM_RUBY=$(type -p "${TM_RUBY:-ruby}")
+"${TM_RUBY}" -- "$TM_BUNDLE_SUPPORT/PerlCritic/perlcritic.rb"</string>
+	<key>input</key>
+	<string>document</string>
+	<key>keyEquivalent</key>
+	<string>^@c</string>
+	<key>name</key>
+	<string>PerlCritic</string>
+	<key>output</key>
+	<string>showAsHTML</string>
+	<key>scope</key>
+	<string>source.perl</string>
+	<key>uuid</key>
+	<string>A7BEB6FA-9DCE-40D7-A5E3-5EB7F1EE68CE</string>
+</dict>
+</plist>
Index: info.plist
===================================================================
--- info.plist	(revision 9767)
+++ info.plist	(working copy)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
 	<key>contactEmailRot13</key>
@@ -18,6 +18,7 @@
 			<string>------------------------------------</string>
 			<string>EC48C79A-82AA-11D9-8753-000D9332809C</string>
 			<string>DA0A5F4B-5F16-11D9-B9C3-000D93589AF6</string>
+			<string>5C086773-E02D-48BE-871C-13A8AC38A41E</string>
 			<string>DA0A6096-5F16-11D9-B9C3-000D93589AF6</string>
 			<string>CF2CA4F9-82A7-11D9-8753-000D9332809C</string>
 			<string>DA0A5E1E-5F16-11D9-B9C3-000D93589AF6</string>
@@ -41,17 +42,39 @@
 			<string>CEE866A5-FA4B-4C5D-A80C-137A620E825E</string>
 			<string>------------------------------------</string>
 			<string>4F1B9AE2-F90C-4A1B-B7D0-FE59D236B12B</string>
+			<string>1B0FB64D-63C1-469E-B0B6-945477603B01</string>
 		</array>
 		<key>submenus</key>
-		<dict/>
+		<dict>
+			<key>5C086773-E02D-48BE-871C-13A8AC38A41E</key>
+			<dict>
+				<key>items</key>
+				<array>
+					<string>A7BEB6FA-9DCE-40D7-A5E3-5EB7F1EE68CE</string>
+					<string>------------------------------------</string>
+					<string>E88EB72E-9CBC-45ED-9C74-BFF2ADAFF408</string>
+					<string>C19FD4CB-4D6A-4193-A701-CFD2E3A9142B</string>
+					<string>29B537A2-3ED8-4862-A0BE-D6EBCD734CDF</string>
+					<string>93F831D4-E880-481A-98CC-23EF3D057CA1</string>
+					<string>D511D84B-0CAF-4769-8BA7-6F509E0DA931</string>
+				</array>
+				<key>name</key>
+				<string>PerlCritic</string>
+			</dict>
+		</dict>
 	</dict>
 	<key>name</key>
 	<string>Perl</string>
 	<key>ordering</key>
 	<array>
 		<string>2F3DB2EF-6B9E-4E5F-87A8-3675680E5C0D</string>
-		<string>02196551-D037-4254-8A2F-7A075A628EF1</string>
 		<string>DA0A5F4B-5F16-11D9-B9C3-000D93589AF6</string>
+		<string>A7BEB6FA-9DCE-40D7-A5E3-5EB7F1EE68CE</string>
+		<string>E88EB72E-9CBC-45ED-9C74-BFF2ADAFF408</string>
+		<string>C19FD4CB-4D6A-4193-A701-CFD2E3A9142B</string>
+		<string>29B537A2-3ED8-4862-A0BE-D6EBCD734CDF</string>
+		<string>93F831D4-E880-481A-98CC-23EF3D057CA1</string>
+		<string>D511D84B-0CAF-4769-8BA7-6F509E0DA931</string>
 		<string>DA0A6096-5F16-11D9-B9C3-000D93589AF6</string>
 		<string>CF2CA4F9-82A7-11D9-8753-000D9332809C</string>
 		<string>DA0A5D89-5F16-11D9-B9C3-000D93589AF6</string>
@@ -74,9 +97,9 @@
 		<string>4FB403FC-F441-447F-9AAD-E2BE13AD49ED</string>
 		<string>CEE866A5-FA4B-4C5D-A80C-137A620E825E</string>
 		<string>4F1B9AE2-F90C-4A1B-B7D0-FE59D236B12B</string>
-		<string>A08E9AF5-1D0A-48C9-A7A9-25C1E59B02A7</string>
 		<string>EDBFE125-6B1C-11D9-9189-000D93589AF6</string>
 		<string>C1EE8DC8-117D-4BC6-8E69-97D51EAA58D2</string>
+		<string>1B0FB64D-63C1-469E-B0B6-945477603B01</string>
 	</array>
 	<key>uuid</key>
 	<string>4679B572-6227-11D9-BFB1-000D93589AF6</string>
Index: Support/PerlCritic/perlcritic.rb
===================================================================
--- Support/PerlCritic/perlcritic.rb	(revision 0)
+++ Support/PerlCritic/perlcritic.rb	(revision 0)
@@ -0,0 +1,34 @@
+require "#{ENV["TM_SUPPORT_PATH"]}/lib/scriptmate"
+
+class PerlCriticScript < UserScript
+  def lang; "Perl" end
+  def executable; @hashbang || ENV['TM_PERLCRITIC'] || 'perlcritic' end
+  def args
+    []
+  end
+  def version_string
+    "perlcritic " + %x{#{executable} --Version}.chomp
+  end
+end
+
+class PerlCritic < ScriptMate
+  def filter_stdout(str)
+    return ( str.map do |line|
+      if line =~ /.*at line (\d+), column (\d+).*\(Severity: (\d)\)/
+        line_count, column_count, severity = $1, $2, $3.to_i
+        url = (ENV.has_key? 'TM_FILEPATH') ? "&amp;url=file://#{ENV['TM_FILEPATH']}" : ""
+        case severity
+          when 4..5
+            color = (severity == 5) ? "Red" : "GoldenRod"
+            color_style = " color: #{color}"
+          else
+            color_style = " color: DodgerBlue"
+        end
+        "<span><a style=\"text-decoration:none; #{color_style}\" href=\"txmt://open?line=#{line_count}&amp;column=#{column_count}#{url}\">#{$&}</a></span><br/>"
+      end
+    end.join )
+  end
+end
+
+perlcritic = PerlCriticScript.new(STDIN.read)
+PerlCritic.new(perlcritic).emit_html
\ No newline at end of file
