+(defun perl-mode-defaults ()
+ ;; per perl-mode help, gnu style:
+ (setq perl-indent-level 2
+ perl-continued-statement-offset 2
+ perl-continued-brace-offset 0
+ perl-brace-offset 0
+ perl-brace-imaginary-offset 0
+ perl-label-offset -2
+ )
+ (define-key perl-mode-map (kbd "C-\\") 'perl-iank-regex)
+
+ )
+(add-hook 'perl-mode-hook 'perl-mode-defaults)
+
+
+;; in perl, sometimes a missing semicolon will cause the
+;; program to work partly and for an error that is not near the missing semicolon.
+;; This works super well to find missing semicolons.
+(defun perl-iank-regex ()
+ "Start regexp isearch forward with pre-populated search string."
+ (interactive)
+ (let ((search-string "^[^#]*[^
+{};,]$"))
+ (isearch-mode t t nil nil)
+ (setq isearch-string search-string
+ isearch-message search-string)
+ (isearch-push-state)
+ (isearch-search-and-update)))
+
+;; regex for perl files to find missing semicolons: