Define a simple backend in perl-mode.el, which cperl-mode.el also
uses.
* lisp/progmodes/cperl-mode.el (cperl-mode): Add to
flymake-diagnostic-functions.
* lisp/progmodes/flymake-proc.el
(flymake-proc-allowed-file-name-masks): Disable legacy backend
for perl files.
* lisp/progmodes/perl-mode.el (perl-flymake-command): New
defcustom.
(perl--flymake-proc): New buffer-local variable.
(perl-flymake): New function.
(perl-mode): Add to flymake-diagnostic-functions.