5 ms·
I discovered Perl basically by accident. For scripting/systems administration its simply unmatched. It's been clearly designed for speed and utility which is wh
by kdklol 3y ago
I discovered Perl basically by accident. For scripting/systems administration its simply unmatched. It's been clearly designed for speed and utility which is what I always wanted and I'm a bit disappointed nobody ever mentioned it to me. I'm 20-something btw, so it's not just ravings of an old man.
I think the catastrophe happened when people mistook this it for a backend development language... and it somehow worked. Not well, but it did, which is it's own quality.
I slowly started learning it half a year ago and it's been really useful for scripts. It's indeed more robust than POSIX shell which tends to have baked in assumptions about the system which may not transfer well onto different platforms. No regrets - the grey beards were right!
- tenderfault 3y agoi am a grey beard. i confirm "the catastrophe happened when people mistook this it for a backend development language"
- jqcoffey 3y agoI suppose I’m a grey beard (in industry is 96ish) and I mean, it’s fine as a backend language in so far as dynamically (or even loosely) typed languages go. It’s just as easy (or hard) to write modular well tested code as in any number of other languages in wide use for backend services, in my XP.
- HybridCurve 3y agoYes, 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 ago