To reproduce (in trunk or 23.0.96): 1. Stuff the following six lines of "code" (two of them blank) into the "foo.pl" file: =head1 Testing This is a test case line with lots of stupid text. This is a test case line with a C<#> and lots of stupid text. =cut 2. "emacs -Q foo.pl" 3. Move the cursor to any point in the fourth line (the one with "C<#>") and type "M-q". This will produce the following user-unfriendly error: Search failed: "\\(^\\|\\s-\\);?#+ *" This directed my attention to the following code near the end of fill-comment-paragraph: (save-excursion (goto-char beg) (if (looking-at fill-prefix) nil (re-search-forward comment-start-skip))) which seems to make two bad assumptions: That comment-start-skip is never nil (though its documentation asserts otherwise), and that it matches before the end of the buffer (which is trivially false at EOB). The attached patch removes these assumptions, and makes the "Search failed" error go away. Unfortunately, this isn't enought to fix perl-mode: Instead of signalling an error, it does nothing, which is not right, either. The deeper problem there is that M-q in perl-mode doesn't distinguish between POD syntax and Perl code proper, and tries to treat the "#" as the start of a single-line comment, even though that is not possible in POD. But fixing that would require a more intrusive patch, and the fill-comment-paragraph code is wrong in any case, so I submit this fix separately on the chance that it might be considered suitable for 23.1. -- Bob Rogers http://www.rgrjr.com/