In general, use perl for glue code and reports, not for business logic.
Perl code should be as simple as possible. That means:
- Use as few language features as possible.
- Use as few lines as possible, as long as they're readable.
- Don't overdesign.
- Don't try to write perl that looks like java.
Avoid rewriting functionality that is present in the standard library.
Separate functionality out into multiple small scripts, the smallest meaningful rerunnable units. For example, have one script handle generating a report and another script handle distributing it.
Always "use strict".
Avoid using $_ in loops except for regular expressions.
Avoid reversed flow control operators except for error handling ("doSomething or die()").
Avoid redundant comments.
Avoid overloading on context. (e.g. sub fu { wantarray() ? X() : Y() })
Avoid special symbol variables. Use the long versions and "use English" (e.g. "$INPUT_RECORD_SEPARATOR" instead of $/). Comment appropriately.
Avoid using shell tools (e.g "awk", "grep", and even "date" and "cp"). If perl can do it, do it in perl.
Prefer "my" over "local".
Put "my" declarations in the tightest possible scope.
Have users of modules explicitly import the tokens that they want (e.g. "use SomeModule qw( SomeFunc $SomVar )").
Avoid writing huge modules with lots of independent functionality; people are afraid to change them.
Avoid writing modules altogether, unless you're absolutely sure that your code will be reused.
If you're using references, have the first character of the expression reflect the type of the expression (e.g. use "$somearrayref->[3]" instead of "@$somearrayref[3]").
If your "configuration" is sufficiently complex (or unchanging) just define at the top of your script.