I don't think this is a good example. I can't imagine that your script uses cookies without any form decoding, page formatting or interaction with a file or database of some sort. You do all these things by hand too? The
cookie function does a lot of things you neglect in your simple
print statement, like entity encoding and expiry date processing. Also, your statement is short, but also plain wrong (no doublequote escaping).
now, i know, that perl-programmers love short code. The less writing, the better.
I can only speak for myself, but I suspect that lots of other Perl programmers agree with my if I say that the quote above is false. I like clear code. In Perl, that often goes hand in hand with short code because of the expressiveness of the language. I like Perl "golfing", but not in production code where I (and the team I work with) have to maintain it. There, I strive to create solid, clear, maintainable code.
Most of the time, modules take a lot of work out of your hands and let you concentrate on the problem you're trying to solve. I probably could write a database interface or XML parser if I wanted to, but very capable people already have done so, excellently I think, and let me focus on the problems I have to deal with.
Arjen
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
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:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.