As the number of tests for (c)perl mode increases, the test file turns out to be somewhat untidy. The patch establishes a consistent naming scheme, factors out a piece of code which is used in several tests, and reorders the tests. The patch also eliminates a warning caused by using (next-line) instead of (forward-line 1), and allows the tests to run under Emacs 26.