Emacs は完全なパーサーではないことを考えると、構文を非常によく理解する素晴らしい機能を備えています。
これを init ファイルで試してください。
(defun my-cperl-indent-command ()
"indent as cperl normally
indent relatively inside multi-line strings.
"
(interactive)
(let ((state (syntax-ppss)))
(if (and (nth 3 state) ;string
(and (nth 8 state) ;multi-line?
(< (nth 8 state) (point-at-bol))))
(indent-relative)
(cperl-indent-command))))
(eval-after-load "cperl-mode" '(define-key cperl-mode-map [remap cperl-indent-command] 'my-cperl-indent-command))
もちろん、indent-relative
やりたいことを正確に実行するには、まだ微調整する必要があります。見るtab-to-tab-stop