DigitalKitty has asked for the wisdom of the Perl Monks concerning the following question:
There are literally thousands of perl tutorials on the web and dozens of books available. I was curious about what method(s) you either are using to learn perl or have already employed.
Reading a book (e.g. Learning Perl? Programming Perl? Beginning /Mastering Perl for Bioinformatics?) and typing code snippets and/or assigned problems at the end of each chapter? Did/Does your school offer a formal perl course? Reading online tutorials?
What method(s) have proved most successful for you?
Thanks,
~Katie
Edit: s/learning/learn/;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: The Road to Enlightenment?
by Joost (Canon) on Oct 03, 2007 at 01:26 UTC | |
I would also recommend a hard smack in the head with some OO language like Java (and I don't even think Java is all that OO; it's just OO enough to be disruptive) And a kick in the face with something functional like LISP/Scheme. What I mean with the above two lines is: nobody can be a good programmer without *really understanding* OO and functional programming. the great thing about perl is, that you can actually use *most* functional and OO techniques without being forced to. update: more than any book I know, the camel book will teach you "the perl way" - i.e it will explain how to do stuff and why. I can recommend many more books, but if you're going for perl, it's at the top of the list for me.
| [reply] |
Re: The Road to Enlightenment?
by blokhead (Monsignor) on Oct 03, 2007 at 01:33 UTC | |
What method(s) have proved most successful for you?Plain and simple, I became fluent in Perl only by hanging out on Perlmonks for a few years. I thought I knew my stuff before I came here, but I was in for quite an eye-opener. I don't think any other approach could have been nearly as effective, at least for me. I have a few Perl books but I never really looked at them -- the monastery and perldoc have everything I might ever need. I learned algorithms and other useful programming paradigms (e.g, functional programming, recursion) from years and years of university classes. This high-level stuff can apply to any language, and is just as important as knowing a language well enough to apply it effectively. It took a lot more time to become really comfortable in the computer science, compared to the programming. I feel like I have all the programming skills I will ever need, but I can never learn enough computer science. blokhead | [reply] |
Re: The Road to Enlightenment?
by bradenshep (Beadle) on Oct 03, 2007 at 02:48 UTC | |
I found Perl somewhat odd at first, coming from a Java viewpoint. I was worried that loose typing would "guess wrong" and use a number where I meant a string or vice versa. Also, subroutine parameters being passed as a flat array was a little mind-bending. But I made the translation. As I did so, I became increasingly astonished and then appalled by the size difference. The final Java was missing a major block of features that were deemed unnecessary, and it was still nearly 500 lines to the 180 of Perl. So I learned from the Camel Book, and the PerlMonks Tutorials, as well as other threads on the monastery and of course the perldocs. I later read Higher Order Perl, and it broadened my mind with functional programming concepts. More recent forays into Haskell have done so even more, and I am now grateful for Perl's tasty blend of functional and imperative concepts. As to my schooling, Perl has always been a dirty secret. They would never actually countenance teaching something so vulgar, but if you corner one of the profs they'll admit that it's an essential tool. | [reply] |
Re: The Road to Enlightenment?
by graff (Chancellor) on Oct 03, 2007 at 04:32 UTC | |
The ranking I first started learning perl by working with a fairly large and elaborate (multi-source-file) app that was written in Perl 4 by someone else. I didn't really have time to read a whole book... During that early introduction phase, I recall being astonished, first of all at the relatively low proportion of alphabetic characters in the code (the app was heavy on regexes and substitutions), and secondly at how quickly I was able to read it with comprehension and adapt it (partly because I already had the basics of regexes from using unix "grep/awk/sed"). The basics of syntax were never a problem for me, since it was close enough to C to be comfortable, and the sigils (back in the perl4 days, at least) were very easy to grasp -- having read their description once (I don't even remember which perldoc man page I read it from), it just stuck with me. I'm sure perldoc perlintro came in very handy in the early days, but by now I hardly remember looking at it. (I'm not sure I would find it so easy if I were to start from scratch these days -- things have gotten more intricate and subtle, esp. with the sigils...) | [reply] [d/l] [select] |
Re: The Road to Enlightenment?
by bruceb3 (Pilgrim) on Oct 03, 2007 at 01:36 UTC | |
To begin with the bundled documentation just start with perlintro and follow the references provided when you come to a section of the language that you need more information about. On a *NIX box this is as simple as this command;
| [reply] [d/l] |
by Joost (Canon) on Oct 03, 2007 at 01:59 UTC | |
That's why I recommended the "programming perl" book. To the OP: if money is tight, or you're comfortable with reading documentation in fairly short - and not too related - chapers, go for the online man-pages. Otherwise, I would still prefer to recommend the "programming perl" (and "learning perl") books from O'Reilly as the the first steps.
| [reply] |
by Muggins (Pilgrim) on Oct 04, 2007 at 13:36 UTC | |
These 2 books often get mentioned. They're quite high level. I found HOP fairly tough going but well worth it. At about that level I absolutely love Perl Hacks and particularly APP2. They're a good read, and guide you through lot's of wonderful Perl trickery. I feel they still work as tutorials even so. HOP, by contrast, concentrates on the functional programming you can do in Perl. Really great book, though. At a slightly lower level, I tend to think (this is going to sound *very* trite) that the best way to learn is by having fun. (yuck). If you enjoy discovering things, they'll stick. Also, some people prefer books, some people prefer just getting stuck in and start coding. In reality, you have to do a bit of both, of course. You need a good tutorial (I'd say Learning Perl, the perl docs, and online help. Whilst Programming Perl sits open on my desk practically every day, I wouldn't recommend it to beginners) Then get thinking how you can use perl to better solve one or two problems, and see how others did it, too. Finally, Perlmonks and meeeting other Perl programmers is invaluable for the discussion. | [reply] |
Re: The Road to Enlightenment?
by apl (Monsignor) on Oct 03, 2007 at 01:22 UTC | |
Not very good Perl, mind you. But it got better, especially after I found this place. | [reply] |
Re: The Road to Enlightenment?
by Withigo (Friar) on Oct 03, 2007 at 07:03 UTC | |
I have yet to find another programming language out there that has such a comprehensive body of knowledge captured within one site. (Perhaps Google's archives of comp.lang.perl.misc, but it's common knowledge that usenet is dead). Perl on dead trees have mostly been decorations for my bookshelves, although MJD's recent "Higher Order Perl" was an enlightening exception to this. The other leg to stand on was of course the practice of programming. Reading only gets you so far, even with an exceptional memory. Write lots of scripts. For me it was reading comp.unix.shell, and for every too-clever one-liner in shell script, I rewrote it in Perl. I got to a point where I could see the solution to nearly any possible sysadmin type of task in my head, in Perl. (It's a lot easier than it sounds). After that got too routine, I wrote my own smaller projects. A website here and there with a database backend, etc. Or find some software which was impressive and clone most of it in Perl. Along the way, the most useful modules on CPAN are pretty much unavoidable, and more specialized use involves examinging the source. Modules such as CGI, DBI, LWP, the HTML parsers, CPAN itself, IO, the Util modules, Acme, POE, the list goes on &etc. There seems to be a peak on the learning curve though, and after a while it seems like there's nothing truly new to do except muck around with XS and the Perl internals while waiting for Perl 6, or keep climbing the ladder to the hang with the wizards on the compilers & languages floor and pitch in on Perl 6. | [reply] |
Re: The Road to Enlightenment?
by perlfan (Vicar) on Oct 03, 2007 at 02:58 UTC | |
My biggest jump in enlightenment came when I read the first few chapters of Conway's Object Oriented Perl. It covers, among other things, closures and the OOP stuff. Computer Science & Perl Programming: Best of TPJ is also good stuff. Since then, using Perl to apply things I've learned during my education have helped keep things fresh. | [reply] |
Re: The Road to Enlightenment?
by chrism01 (Friar) on Oct 03, 2007 at 04:16 UTC | |
After that I largely used the Camel just for keyword/fn definitions and discovered the Cookbook, which IMHO, is worth it's weight in gold. These days I find the docs at http://perldoc.perl.org/ a very good substitute for the Camel, as they are inevitably more up to date and contain lots of examples, plus the various links to key tutorials. Again, YMMV. Plus of course CPAN and here (perlmonks).
Cheers | [reply] |
Re: The Road to Enlightenment?
by talexb (Chancellor) on Oct 03, 2007 at 14:03 UTC | |
I can't really single out one method that works best. I'm much happier with a combination of methods. | [reply] [d/l] |
Re: The Road to Enlightenment?
by Anonymous Monk on Oct 03, 2007 at 07:15 UTC | |
| [reply] |
Re: The Road to Enlightenment?
by blue_cowdawg (Monsignor) on Oct 03, 2007 at 13:47 UTC | |
Same method I use to learn almost anything I do with some notable exceptions. Read up on it, talk to a few folks already doing it, and go do it. Taking up skydiving or something like that needs more hands on instruction! :-) My method of learning Perl was to take a collection of Korn shell scripts that I used to do my backups at AT&T Bell Labs and convert it to Perl. My goal being to eliminate all the pipes and temporary files that I was using to get the job done. Part of the task was tracking what files systems and files were being backed up to what media in an HP Magnetic/Optical disk jukebox across 32 slots. One of the clever things that the backup method used in the end was to create a partition on one of the pieces of media that contained everything to recreate the backup and restore suite that I had created including building Perl itself. But I digress. Over the years I wrote Perl scripts in a vacuum of sorts because I was the only one in my immediate circle writing the stuff. That was until I ended up at Perl Monks. Then I found out that a lot of what I was doing was not ideal. (I won't say wrong... just could have been better.) So it is here at PM that I was able to hone my skills getting feedback from other Perl folk at my meager attempts and scripting. Peter L. Berghold -- Unix Professional Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg | [reply] |
Re: The Road to Enlightenment?
by UnstoppableDrew (Sexton) on Oct 03, 2007 at 14:25 UTC | |
| [reply] |
Re: The Road to Enlightenment?
by dwm042 (Priest) on Oct 03, 2007 at 12:20 UTC | |
The most effective tool for learning in recent times has been reading PerlMonks and trying to answer questions within my ability, and then reading the answers of others. There is nothing quite as effective as an ever changing pool of questions to sharpen your skills on, and an ever changing collection of questions and answers to ponder. | [reply] |
Re: The Road to Enlightenment?
by LighthouseJ (Sexton) on Oct 03, 2007 at 12:53 UTC | |
I took a break from Perl (went to college). When I got back into the workplace, I went with perldoc.perl.org pretty much as a reference guide. I had access to O'Reilly's CD bookshelf but the nuggets of useful information were too few to bother. The cookbooks were good to browse through to see other ways of doing common tasks like parsing text but in the end perldoc.perl.org is where I only go to these days. I've always benefitted the most when learning things but simply looking at examples instead of droning proofs or explanations which is why I believe I prefer the brevity of reference guides over big books.
"The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why." -- `man perl`
| [reply] |
Re: The Road to Enlightenment?
by Anonymous Monk on Oct 03, 2007 at 14:57 UTC | |
Some teachers (my girlfriend's a ski instructor) learn that different people learn very differently. Some folks learn by being taught the theory. Others have to see examples. Some want to follow someone who's actively doing what they are teaching. Others have to try to do things themselves before it sinks in. I've learned something about how I learn as I've grown older. -First, give me the context of what I'm learning: the view from 10000 feet if you will. Don't start at the bottom. -Second, work down to a lower level and tell me how it works. -Third, show me examples to help me when I make stupid syntactical errors and such. -Fourth, give me incrementally more challenging tasks to try. -Repeat until you know enough. So you'll probably repeat the above for most of your life / career. Some books (llama) worked out great for me, because they teach the way I learn. Others (Oracle manuals) are more challenging, since there are few / no examples and no incremental learning - either you get everything right the first time or you're stuck for days. I'm barely an apprentice monk, but following my path to my learning Perl has been very rewarding. Other paths could have caused me to abandon Perl <shudders visibly>. But from the postings, you can see that they were very successful for other monks. As they say, your mileage may vary. | [reply] |
Re: The Road to Enlightenment?
by jethro (Monsignor) on Oct 03, 2007 at 16:06 UTC | |
The perl way is "There's more than one way to do it", and the Camel book is full of sequences like "You can do X with <code...>, or <code...>, but usually you would do <code...>". Because of this the reader gets to see any concept or function more than once, which is as close to learning by repetition as you can get without losing the fun of reading. That said, if you are a beginner to programming at all, you should start with "Learning Perl" or a tutorial. Also, if you are a hard worker, assigned problems help a lot. If not, you should try problems you would like to do (to keep your interest). | [reply] |
Re: The Road to Enlightenment?
by Viko (Acolyte) on Oct 03, 2007 at 16:30 UTC | |
| [reply] |
Re: The Road to Enlightenment?
by toma (Vicar) on Oct 04, 2007 at 07:57 UTC | |
TheDamian convinced me that my brain has been temporarily stored in a Mayonnaise jar on the front porch, and it can be retrieved with a snippet of perl. I hope I can run it before I wake up! Beyond thinking out of the box, dominus taught me that there is no box. We are better off without boxes. Many monks have been very very good to me. Thanks!
external links below I am grateful to my employer for providing the opportunities to learn at OSCON.
It should work perfectly the first time! - toma
| [reply] |
Re: The Road to Enlightenment?
by perlofwisdom (Pilgrim) on Oct 03, 2007 at 16:09 UTC | |
As a reference book, I like the O'Reilly (Camel) book "Programming Perl" by Larry Wall, Tom Christiansen & Jon Orwant. Best wishes, and welcome to Perl. | [reply] |
Re: The Road to Enlightenment?
by zentara (Archbishop) on Oct 03, 2007 at 16:26 UTC | |
Hey Larry, if you get rich selling locks of hair on Ebay, I would appreciate 10% :-) I'm not really a human, but I play one on earth. Cogito ergo sum a bum | [reply] |
Re: The Road to Enlightenment?
by menolly (Hermit) on Oct 03, 2007 at 22:04 UTC | |
I picked up Perl in the mid 90s, after hearing a lot about how much easier it was for certain classes of task, like networking. I used the pink Camel and friendly Perl folks online to do an honors project for my networking class. Later, I picked up Perl 5 as a side thing at my C/C++ job, and then moved on to doing Perl full time. I don't know if it's still the case, but at one point, conventional wisdom was "If you know how to program, start with the Camel; if you don't, start with the llama". A lot of books have come out since then, and YMMV. These days, I use the Camel and the cookbook as references, and PerlMonks for learning. | [reply] |
Re: The Road to Enlightenment?
by Aim9b (Monk) on Oct 04, 2007 at 01:40 UTC | |
I also read Damian Conways Best Practices and the Perl Cookbook, and while I think they are both very good, I felt I was being told not to use what I'd learned earlier. This was a bit confusing. After about 3 weeks of trial and error with a small utility program, I found this site an what a difference the monks made. Doing is also my best way of learning. While going through the "zoo" of books, I always had my perl up and running. This alowed me to try things immediately, fail miserably, then try again. I use ActiveState Perl on a WinXP box & they have a lot of perl docs too. Hope this was helpful. I'm relatively new to perl & I love it already. | [reply] |
Re: The Road to Enlightenment?
by naikonta (Curate) on Oct 04, 2007 at 18:27 UTC | |
Early 1997: I was asked to put a guessbook on the website, so I got one from Matt's Script (yes that one), made some insignificant modifications, got it to run, and was amazed of new thought on what I can do with programming. Interesting to learn more (I didn't care much then that it was "Perl"), a friend gave me the Llama book. But lacking of programming experience or some computer sience background seemed to be the biggest obstacle for me to grasp the content. My brain was like suffering digesting problem. Months later, I found a short introduction by Selena Sol. It described how to program (CGI) with Perl in a very simple way. Few lines of theory, straightforward examples, and just what I needed to know to start my own (CGI) programs. I was specially deligted with qq() and "here-documents" (I saw a lot of \" in that guestbook program). I also learned later that beside online resources, in front of my nose, there is a bunch of excellent Perl docs I could (and still can, of course) with man perl, man perldata, etc. Feeling enligthened, following the manuals was enjoyful. Later, while I still wrote, I saw a friend coded,
I said, "Cool! What is it?". Now I got introduced to CGI.pm. My excitement was boosted. But, I wasn't always sitting before the computers, so I thought that I needed a printed material so I could read it wherever and whenever I go. Somehow I forgot to got back to the Llama. I wasn't aware about other great Perl books. They weren't even in the local bookstore. I couldn't buy it online. I didn't have a credit card, and I couldn't afford it, after all. So I turned back to the local manual pages, and decided that, "This is my printed material resources!". I didn't use Linux yet, that time. Workstations at office mostly use Win98. So how did I print the manual? Remember the old telnet program in Win98? I used that to login to the server, and executed man perl... commands. I copied-pasted a screen after a screen, use a word processor to layout the text (making heading, monospaced the code sample, etc). When editing was done, I just then printed it using dot matrix printer on the continues form paper, waited patiently until it completed, bearing with the noise, and apologized to the people. Basically, I had "one book" for each man page. I brought them everywhere, proudly answer what it was when friends asking. I read them on the go, on the bed, wherever and whenever possible. I got back to the computer to practice what I've just learnt. So it went, starting from perldata, perlsyn, and so on, for the rest of the year. Early 1998: I became more confident with Perl. Something called PHP came along. Uninterested. I moved on to perlref, and there I got stuck. I just always took it in the wrong way. I even wrote,
I can't remember how the enlightenment came to visit, but it was when reading the perldsc. And another pandora box opened. Moving on to perlobj, perlmod, and, perltoot "books" was fascinating. I'm not saying it was easy, but it wasn't as hard as when I started to learn Perl. Unfortunately, I stopped on perlembed "book", and didn't even open perlguts. Later, I started to read "real books", and other Internet resources, as well as the printed TPJ (office subscription). Still don't understand C, until now. But I was happy with Perl, already. The rest was just history. I heard about Python. Interested, but dropped it soon. Still didn't pay attention to the evolving PHP. Java later provoked with full of buzzwords, but never interested. JavaScript was entirely different beast, but went side by side with Perl. And I think that I "suffered" this "hammer syndrome". I learnt more about programming, understanding more on OO, and even enjoying my software engineering experience, at general. All with Perl, and other languages (by literature comparison). In short, I was happy with Perl. Well, I'm happy with Perl! Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy! | [reply] [d/l] [select] |
Re: The Road to Enlightenment?
by Argel (Prior) on Oct 04, 2007 at 23:30 UTC | |
Books I have found helpful (links to Amazon): Books I have heard enough good things about to recommend even though I have no personal experience with them: | [reply] |
Re: The Road to Enlightenment?
by arkturuz (Curate) on Oct 04, 2007 at 13:24 UTC | |
In the begining I learned the most from 'Learning Perl' book I borrowed from a local library. Later on I read 'Programming Perl' which was a real fun. (And yes, 'Learning Perl' was fun too.) After that, getting friendly with 'perldoc' got me a good ride, and I'm on it all the time. I own a few Perl books, but rarely read them now, unless on some boring sunny afternoons. I never used any of those beginner-tutorials for Perl. | [reply] |
Re: The Road to Enlightenment?
by Rudif (Hermit) on Oct 03, 2007 at 22:43 UTC | |
| [reply] |
Re: The Road to Enlightenment?
by Tabari (Monk) on Oct 04, 2007 at 09:54 UTC | |
Includes non perl as well as perl stuff Tabari | [reply] |
Re: The Road to Enlightenment?
by arc_of_descent (Hermit) on Oct 06, 2007 at 11:18 UTC | |
I would not say I'm even close to enlightenment yet, but I think I can give you some suggestions. Plain and simple. Find work that is challenging (in Perl, of course) and your first impression is that you can't do it. You know, that project you've just got and it looks daunting so you'd rather take on something else? Just go ahead and take it on. You'll learn a lot on the way. I'm not saying this might work for you. Its just how I learned most of my current Perl skill set. | [reply] |
Re: The Road to Enlightenment?
by Anonymous Monk on Oct 04, 2007 at 05:43 UTC | |
| [reply] |
by Withigo (Friar) on Oct 04, 2007 at 07:35 UTC | |
Hey, wait a second, Larry, is that you? | [reply] |
by TimToady (Parson) on Oct 04, 2007 at 15:16 UTC | |
| [reply] |