4 ms·
Yes, it's a great language for this application. Make sure you read Damian Conway's book "Perl Best Practices" as a guideline for crafting consistent and reada
by HybridCurve 3y ago
Yes, it's a great language for this application.
Make sure you read Damian Conway's book "Perl Best Practices" as a guideline for crafting consistent and readable code. People's biggest gripes about this language generally revolve around poorly written code that is hard to read. Also, when writing regexes it helps to paste one or more example lines or matches above the regex so there is no question about what you are trying to do. 9/10 times I've found debugging SA perl scripts comes down to an unhandled pattern in a regex and this is what helps the most when re-writing it to ensure it doesn't break anything else.
- cjohnson318 3y agoCan you recommend any free resources that amount to an "effective minimal core" or crash course for Perl? I'M a Python dev, but I use sed/cat a great deal, and maybe Perl is a better solution. (Take me to the Dark Side.)
- drivers99 3y agoedit: you said "free", but this isn't technically free For me, going through the llama book (Learning Perl) and actually doing the exercises was great. I would think I got it after reading the chapter, but when I went to do the exercise, I realized I had to look up the info again. Putting it into practice was great for internalizing the information. I can't believe there's an 8th edition now (from 2021!). I must have used the 2nd edition (1997) at the most, so I'm assuming it's still good. Since you know sed/awk, you're going to see where a lot of the ideas came from.
- serallak 3y agoI'd suggest the last edition of Modern Perl. It is dated but it's free online: http://modernperlbooks.com/books/modern_perl_2016/index.html http://modernperlbooks.com/books/modern_perl_2016/index.html
- HybridCurve 3y agoDifficult to say. I picked up a bunch of info from perl.org: https://perldoc.perl.org/perl#Tutorials https://perldoc.perl.org/perl#Tutorials Perlmonks was a good source for certain specifics. Doing is better than reading IMO. Open files, parse log data or such with regexes, sort them into a hash, and return that by reference. Perl has different ways of doing things that aren't common in some languages such as how it deals with binary data (see pack/unpack). Coming from python, I would say forego the delving into OOP aspect of perl as it is more of an afterthought than a core feature. Focus on understanding data management with scalars, lists, hashes, and the core functions (Perl has native functions for things like sorting which are quite useful). I managed to go from C to perl over a weekend but it takes hours of practice to improve.
- kdklol 3y agoThank you everyone in this thread for suggestions. I personally learn by practice. Writing stuff. I've read good things about the "Modern Perl" but I'll check out Conway if people here are vouching for it. Also, Perl's manpages actually teach you the language - another advantage of an older language from a time when people knew what manpages were and how to write them. They're not OpenBSD quality, but they're pretty good from my experience.
- clscott 3y agoI recommend this blog post to all devs I work with that need to pick up Perl: https://qntm.org/perl_en https://qntm.org/perl_en
- 0x445442 3y ago> Make sure you read Damian Conway's book "Perl Best Practices" Extend this to any media you can by Conway. He's in my top 3 of tech presenters and I'm really not that into Perl.
- inferiorhuman 3y agoThe problem with Perl isn't that you cannot write good, comprehensible code it's that doing so is difficult.
- uhtred 3y agoLol, what? Why? Are you that bad at programming that you can't structure code well without guardrails?
- LanceH 3y agoLots of bad code was written in Perl by people who didn't know how to program. This is a feature, though. Tons of valuable software was created with the assistance of a language that attempts to get things done more than it tries to hold people to the implementor's dogma.
- deleted 3y ago[deleted]
- inferiorhuman 3y agoIf you'd like to spend your time thumping your chest, go right ahead. I'd rather code.
- uhtred 3y agoNot at all, I'm an average programmer at best. But writing well structured code is about being conscientious of your team mates, it's about not being a show off, it's about not being arrogant even if you are the smartest person in the room, it's about reading some books on clean code, knowing what KISS is. If someone can't write readable, maintainable, understandable code unless the language has certain guard rails in place, then they aren't doing the above things and I would consider them a toxic team mate, no matter how much of a rock star programmer they are.
- inferiorhuman 3y ago
- donaldihunter 3y agohttp://modernperlbooks.com/books/modern_perl_2016/index.html http://modernperlbooks.com/books/modern_perl_2016/index.html is also a good read.