I am currently trying to learn Perl.
I have been told that the Riley animal books are good, but I feel like I have to know the questions to ask to make them worth anything.
I am currently using Laura Lemay's book "Learn Perl in 21 Days". I have used her books before and found them to be good, but lacking in some areas.
Have any of you used this book, and have you found something better?
Thanks,
-heather
It has a LOT of practical code examples. It seems to be written in a way that will encourage you to get your hands dirty vs. teaching you the fundamentals.
A good beginners book that I'm digesting right now is "Perl and CGI for the World Wide Web" by Elizabeth Castro. I'm constantly amazed how this gifted technical writer makes Perl and CGI seem almost friendly!
A good beginners book that I'm digesting right now is "Perl and CGI for the World Wide Web" by Elizabeth Castro. I'm constantly amazed how this gifted technical writer makes Perl and CGI seem almost friendly!
I concur. I love that book. :)
-G
But to really LEARN Perl, not just read about Perl, I suggest three things.
#1 - First, check out other people's Perl code. Of course you'll run into things that blow your mind, I still do after 4 years of Perling. Because there's "more than one way to do it" you are always exposed to new concepts that way, even when it comes to simple things like "reading a file."
#2 - Visit the IRC channel #perl on DalNet. I find the crowd there extremely helpful, friendly, and if you honestly want to learn perl they will have endless patience with you.
#3 - Believe it or not, I think that looking at what they call "Obfuscated Perl Contests" is quite fun, and quite educational. These are contests where people try to write the ugliest most incomprehensible Perl code possible. Trying to determine the output of these monstrosities actually helped my understanding of Perl, as most of these programs employ several little-known aspects of the language.
Bolotomus
Just Another Perl Hacker
s**'@z!~;()=~$x>;%x>l;$(,<x>'*e;y*%z),$;@=<x>!;h(l~;*punch jokers;halt;*;print;
I agree, don't get me wrong, but the thing I am most concerned about is, as a newbie to Perl, I don't know what 'good Perl' looks like.
I could be studying somthing that is completely hacked/ duct taped together, and wouldn't even know it. If I am going to study someone else's code, I want to know that it is .. clean.
Ya dig?
-G
Good point! I didn't necessarily mean to look at some Freshman student's Perl code, or some hacker's Perl code. Look at code written by Randall Schwartz or Tom Christiansen, or of course Larry Wall himself. Or any of the distribution modules like CGI.pm. Undoubtedly you'll run into lines of code that make your head spin, and you say "What the heck does this mean?" Great! Now you have a puzzle on your hands. Soon expressions that looked like line-noise to you a short while ago will become crystal clear.
You'll also then be on your way to developing your own style in Perl which bests matches your overall programming style. Some people like to use the inverted-if syntax (e.g., exit if $x=0) while others avoid it. Some people use regexes for everything while others like to use split and substr(). Randall Schwartz (et al) loves to nest powerful functions like map{} and split and join in funky ways to perform amazing data transformations in single expressions. It's all up to you.
Even though I've been doing Perl for a few years now my style is just starting to emerge. I'm still pretty much a big copy-cat... :)
Take care
Bolot
In fact, I have observed that 95% of all "How do I do ___ in Perl?" questions that I see online can be answered within the pages of this precious tome.