It's good to take a look at someone else's code in the language you want to learn. The caveat here is that you could learn bad habits from the person who wrote the code. There's one person in particular (whom I won't name, but most of the monks know who I'm mentioning) who has damaged a bunch of budding Perl programmers' beginning attempts. A book that comes with ample examples, therefore, is a good idea, because the author generally knows how to do things correctly.
In the case of Perl, O'Reilly has a _Perl CD Bookshelf_ which is pricey but which contains searchable text of a number of books on Perl. _Learning Perl_ has good examples, too. The book doesn't come with a CD last I noticed, but one of the authors, Randal Schwartz, has a whole site full of handy examples on his company site at
http://www.stonehenge.com. Undoubtably some of the other books people have mentioned have examples in some electronic form in one place or another.
I'm a firm believer that changing working code line by line to see what breaks and what useful working changes you can make to it is a good way to learn. I feel this is true no matter the language.
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.