Here's the template.el template I use for .pm files:
# Copyright (c) (>>>YEAR<<<) Jonathan Rockway <jrockway@cpan.org>
package (>>>PACKAGE_NAME<<<);
use strict;
use warnings;
(>>>POINT<<<)
1;
>>>TEMPLATE-DEFINITION-SECTION<<<
("PACKAGE_NAME" (insert-string
(let ((filename (buffer-file-name)))
(if (string-match "lib/\\(.+\\)[.]pm$" filename)
(let ((mod (match-string 1 filename)))
(while (string-match "/" mod)
(setq mod (replace-match "::" nil nil mod)))
mod)
(if (string-match "\\([^/]+\\)[.]pm$" filename)
(match-string 1 filename)
"UNKNOWN")))
))
The nice part is that it knows what the name of your module is. If you C-x C-f lib/Foo/Bar/Baz.pm, then the package declaration at the top will say Foo::Bar::Baz (and will auto-create lib/Foo/Bar for you). I've been using this for a few months and realized that it's too convenient to keep to myself :)