You've definitely hit on the truth -- you just can't
learn how to write decent code (or do much of anything else,
for that matter) by reading books, man pages, or websites:
you have to do. I'm not sure that exercises
are the way to go, though. I learn a lot better if I have
some real task to do, something more motivating than a
contrived exercise.
Instead of (or as well as: since people learn in
different ways, the more resources PM has the better)
exercises, how about a list of common, useful tasks that
perl's really good for? We could provide links to useful
information (or at least pointers to the right man pages),
some examples, and so on: the idea wouldn't be to get people
to solve the problems presented, but to spark the "hey,
wouldn't it be cool if..." train of thought, and give enough
help that they wouldn't run into brick walls.
Some stuff that I can think of, off the top of my head:
- log parsing
- web page automation
- document translation
This would also be a great way to introduce people to CPAN,
and especially to idiomatic ways of doing things in Perl.
(My most common learning experience, especially with Perl,
is to do something the first way that comes to mind, then a
few weeks later find the right idiom for the job -- and
suddenly my code is half as big, twice as effective, and
four times as readable. And short of reading good code,
it's difficult to find idioms easily.)
--
:wq
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.