Suppose you want to write a program in Perl. (Suppose you have written a program in Perl.) If the thesis behind what I call Modern Perl is correct, you can write that program well or you can write that program poorly. (For supporting arguments for that thesis, see Piers Cawley's A tale of two languages.)
Likely you've seen examples of Poorly Written Perl on the Internet. They serve as the YouTube comments to Nabokov of English language. In other words, the proper response to a reluctant admission that:
Yes, I know that Perl can be written in an object-oriented and readable way.
— Tim Bray, D.P.H.
... or that:
There's also been a push in some applications to rewrite Perl utilities in Bash to enhance portability between platforms. While Perl exists on just about every platform out there, there are vagaries that can cause issues with differing Perl versions, which then leads to portability problems.
— Paul Venezia, Is it still libelous if you end your titles with question marks?
... the proper response is "Why didn't you write your code with maintainability in mind?"
I know, I know. That's not helpful. Here's a quick checklist to help those of you writing Perl (or those of you trying to hire people to write Perl (or those of you trying to hire people to learn to write Perl)) to determine if you're capable of writing Perl well:
- Do you know how to use the Perl documentation
- Do you use CPAN modules?
- Do you use the CPAN distribution layout for organizing your code?
- Have you enabled strictures and warnings? Is the resulting code clean of warnings and errors?
- Are you using the standard Perl testing framework? (Did you write tests at all?)
- Do you have an automated Perl configuration, build, dependency resolution, installation, and distribution mechanism?
- Does your code conform to local Perl layout guidelines?
- Does your code conform to Perl community standards for maintainability and correctness?
- Are you familiar with the local Perl mongers group?
- Are you using a recent version of Perl?
- Are you familiar with writing secure Perl?
- Do you use source control?
- Do you use functions?
- Do you use modules?
- Do you use objects?
- Do you use Moose or another abstraction mechanism from the CPAN?
- Do you document your Perl code?
- Do you use language constructs you don't understand, copied and pasted from elsewhere, smushed together into a hateful melange of barely-working confusion you occasionally tweak just to see what happens, and one afternoon you get sick of it and call it done?
You don't have to answer all of those questions in the correct way to write good and maintainable Perl, but if you answer most of those questions in the wrong way, of course you'll write bad code.
Perl allows people to accomplish their tasks without having to learn much, without having to participate in strange and unfamiliar ceremonies, and without even being much good at programming at all. That's by design, and that's a good thing for very specific circumstances. Yet if you approach programming as if it were merely typing and retyping until something barely working fell out of your typewriter, you're going to make lots of messes, and no language can save you from an unprofessional lack of discipline.
Writing good code requires discipline in any language.
Unfortunately Taint works less than it should because so many people don't use it.
Can you write another post on answers (i.e. pattern and practice) on your own questions? Thanks.
I was inspired by your post to go see if there's a local Perl Mongers group here (I live in Buenos Aires, which hosted the first regional PyCon in South America a couple of years ago). It looks like there used to be, and their web site is still up, but the last meeting listed on their web site was in 2007. So, I signed up for their mailing list, in case they're just not updating the web site. I'm not optimistic, though.
When you say, "Have you enabled strictusers", what does "strictusers" refer to? Did you just paste the word "users" after "strict" by mistake?
By the way, your configuration of Movable Type sucks. Trying to comment with JS turned off gave me enigmatic "Invalid request" errors.