Call me a "heretic", or consider me still but an "egg" (as I do), but I think I would have to agree that there is no "true" style. As some come to perl from other languages, with the styles those languages impressed upon them, and others find perl without such shackles, we see the philosophy of TMTOWTDI show up even in such things as spacing and bracing and the other small details of coding. The important thing is that the code is usable, maintainable, and that someone can follow it, and if consistently done, so much the better. Just as an example, for code I write only for myself, I tend towards tabs, but sometimes 2 or 4 spaces; for code I post on here recently (and even some for work), I try to first run it through PerlTidy
(1) with indention at 4 spaces.(2)
I have found this discussion (and most others) quite instructive, and a help as I continue still to find my way still along this path we call Perl.
- But then again, I also prefer lines of either 75 or 123 or 132 characters, and yes, for code I'm having to wade through for myself, I sometimes prefer cuddled elses.(3)
- Just my 2 cents, for what it's worth after inflation.
- But this is also part of why I still consider myself an "egg".
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- 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.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||