It all depends on the kind of code, and the intended audience. For CPAN modules, I try to optimize for performance if it doesn't hurt readability too much. This code can be understood by experienced Perl programmers.
For one-off quick hacks and oneliners, I don't care about readability and will use any technique that saves me from having to write much more code. This code can often be understood by people who are experienced in Perl. I will use ~~ instead of scalar.
For example code in documentation, I try to optimize for readability. However, I will continue to assume that the reader is at least comfortable with Perl. That means that I still do use statement modifiers and the $_ variable.
The Perl novice will have to find a way to plough through the first part of learning Perl: dealing with its sometimes exotic syntax. In some ways that is a barrier of entry, and keeps dumb and uninterested people away. It's not hard to learn how Perl works, there's lot of documentation to explain it. If you're learning Perl, you're only a real novice for a few days anyway.
I suggest that people who are not comfortable with Perl, should not be using it.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||