How to go about learning perl

How to go about learning perl

狼亦尘 发布于 2021-11-26 字数 680 浏览 702 回复 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

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

鸢与 2022-06-07 9 楼

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.
陪我终i 2022-06-07 8 楼

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.

七色彩虹 2022-06-07 7 楼

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.)

别把无礼当个性 2022-06-07 6 楼

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

请帮我爱他 2022-06-07 5 楼

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.

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).

沉睡月亮 2022-06-07 3 楼

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.

我们的影子 2022-06-07 2 楼

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

苍风燃霜 2022-06-07 1 楼

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.