tags:

views:

250

answers:

9

I am a bioinformatics student and am in the process of learning perl. I don't have a strong programming background but would like for that to change.

Right now I am in the process of reading/following and coding from this book

I want to know is this the best way to go about learning perl? Should I be experimenting with regular expressions more? Should I keep trying writing sample perl scripts?

Related: what are good books for learning perl

+7  A: 

The definitive learning Perl book is aptly called "Learning Perl". Get it.

I cannot recommend writing sample scripts. Try to write something that you need. It doesn't have to be a big endeavor; everyone needs a little tool now and then. Writing sample scripts is boring; always was, always will be.

innaM
agreed. write something that makes sense to you and is usefull
Omnipresent
and refactor it often as you learn more about the language.
scooterXL
You may also hear this book referred to as "the camel book."
R. Bemrose
@R. Bemrose: "Learning Perl" is the Llama book, "Programming Perl" is the Camel.
A: 

You really can't go wrong with the Lama book

Learning Perl

There's quite a library of O'Reilly books on Perl. Programming Perl is also excellent and probably worth having to complement the Lama book - I have both on my shelves and although I haven't needed to code in Perl for quite some time I found these books together a solid enough combination. The Perl Cookbook came in useful too (yes, this is one of those areas that O'Reilly has pretty much sew up :-).

As to practical exercises, Perl does have something of a reputation as a 'Write Only' language, so look for clear examples and if you are confused by anything don't necessarily assume that the problem is you - there's always more than one way to do it.

Cruachan
+3  A: 

This seems like a potential duplicate as here are some related questions:

Scott Saad
A: 

You also might want to look for examples of good code to study.

daotoad
+2  A: 

Like most other answers on this post I can't disagree with the choice of "Learning Perl" as your first Perl text. Keep a copy of the perldoc documentation available for quick reference(I prefer using the html/pdf format which is available as a download from the main page).

In order to keep things from getting boring, especially in the initial stages I started converting my shell scripts to Perl, hacking away at it until I had three or more different versions of the same program with decreasing file size(not great for maintenance though). But then you know what they say - TMTOWTDI. Now I don't bother with shell scripts any more, writing it in Perl results in smaller turnaround times and the code can be easily reused and enhanced.

Once you are familiar with the more advanced concepts and are approaching a level of comfortability with using it for your day-to-day work or just simple one-liners you might want to have a look at Mark Jason Dominus' Higher-Order Perl which, according to me, takes the language and the reader's understanding of it to an entirely new level. The chapter on "Recursion and Callbacks" was a real eye-opener and changed my style completely from that of writing C-programs in Perl to actually writing "Perl" programs in Perl.

muteW
A: 

My experience is that there's nothing better for learning than doing. But you need someone to provide feedback, especially when you hit roadblocks that you can't get past. Stackoverflow is good for that, but, IME, Perlmonks is better in that there is a chatterbox for immediate feedback, as well as their question-and-answer posts for longer questions, combined with a more specialised environment. (And Larry Wall has been rumoured to hang out there, too, as well as a number of the authors of the above-referred-to books.)

Tanktalus
A: 

Learn by doing. Get the books mentioned by others, but the real way to learn is to start a simple project. Mine was a Gtk based SQL editor. If you run into problems ask questions here and on the Perl Beginners list.

Chas. Owens
A: 

The choice of book is can be vary from person to person. So, as bioinformatics student who use perl, don't get any book that called "(X Programming language) for bioinformatics". Usually this kind of book is either.

  • They only give very basic of that programming language. You gonna to miss all the power from that language.
  • Wasting its space on how to use API, which you can find information easily via google.
Tg
+1  A: 

I use the online book "Learning Perl the Hard Way" to teach my coworkers about Perl.

Don't be intimidated by the title, it's just that it's directed at programmers who are already fluent in another language and therefore it doesn't focus on the programming part, but mostly on the Perl part, so it may apply better to your case (or not).

Steve Schnepp
Awesome, this is exactly what I was looking for.
titaniumdecoy