5 ms·
I like the author's list. Very solid and some of the same arguments I try to use when people tell me they don't want to ever mess with Perl because it's unreada
by socialist_coder 5y ago
I like the author's list. Very solid and some of the same arguments I try to use when people tell me they don't want to ever mess with Perl because it's unreadable.
I still haven't found another language as easy and fast to do text manipulation, parsing, calling out to the shell, regex, whatever. For scripting, Perl is awesome.
Recently I've been using Python instead, simply because I feel like I'm the last person in tech who likes Perl. This stuff is all doable in Python but I still miss my good ol' Perl.
My 2 biggest complaints with Python vs Perl are 1) regex's - the perl syntax is so much faster and easier, and 2) running other command line programs from the shell and reading their output. Perl makes both of those things absurdly quick and easy to do.
- petepete 5y agoI wrote Perl (badly) for a few years before moving to Ruby in the mid 2000s. You can really see Perl's influence in Ruby when it comes to text manipulation, everything you need is likely in the standard library. If you're not yet fully sold on Python, Ruby might be worth a try. It's like Perl's elegant, sensible cousin.
- socialist_coder 5y agoRuby... thanks for the suggestion. I'll give it a try next time!
- forgotmypw17 5y agoYou're not the last, and I feel the same way. Perl is popular enough that there is enough documentation out there, stable enough that all that documentation is good, even if it's 20 years old, and niche enough that most of it is written by knowledgeable people. With Python, I first have to ensure that the page I'm reading is no more than 2-3 years old, then the copy and paste requires me to re-fix the code, since the syntax is too brittle to stand up to whitespace changes.
- tzs 5y ago> With Python, I first have to ensure that the page I'm reading is no more than 2-3 years old, then the copy and paste requires me to re-fix the code, since the syntax is too brittle to stand up to whitespace changes. I find that I also often have to re-fix the code because so many Python example writers present their examples as REPL sessions, with the code I want to actually copy littered with ">>>" prompts and the output from each individual line's execution.
- jamal-kumar 5y agoI never got why this was such a huge deal for people to do. In vim it's super easy to just select a bunch of text you've pasted in, elimiate all the whitespace with some << commands, and then select what you need to be indented and >> it back into place. Takes like 5 minutes top even for larger amounts of text... beyond that, what are you even doing copying and pasting that much in? That said I do like perl for many things python just isn't as elegant at and your comment about old documentation still staying fresh is pretty true
- singingfish 5y agoI was reading something about a particularly bad enterprise service bus product where I learned in the comments that everything being a global variable is OK, you just have to clean up after yourself when the job finishes. This comment strikes me as similar - here's a design decision that makes a simple task more complex, and error prone. Not that copying pasting large volumes is a good thing.
- jamal-kumar 5y agoIdk... if it's all tabs v for visual mode, select text :%s/\t/ /g boom selected text to PEP8 standard from tabs same if it's spaced otherwise evenly (Interpreter will give you a hard time if it isn't and won't execute the script, so what even is it if not that). your tabstop settings set to this should be fine for the << >> method. It's really not that hard?
- cutler 5y agoRuby is much closer to Perl than is Python.
- singingfish 5y agowhich is interesting because perl and python are mostly the same (although it's only really possible to implement the python object model in perl than it is to do the opposite)
- cutler 5y agoHow are Perl and Python remotely "mostly the same"? Python has crippled lambdas, ugly dunders, indentation for structure and no built-in regex support.
- mikeryan 5y agoI spent some time in the late 90s struggling with picking up perl for ye olde cgi-bin. It was definitely harder to grok then most, I think if you come up from the shell at that time with a large familiarity with awk and sed it was easier to grok. I think it quickly fell down when it became the way to do dynamic web applications for which it wasn’t really suited. As horrible as php was (then) from a language perspective it’s purpose built nature, made it way easier for early web uses. It did a good job of solving one problem and stayed in its lane. It’s interesting that it seems, for the most part, that Ruby was mostly relegated to it’s use in Rails. It was probably one of the easiest and most intuitive languages I’ve picked up (I never got into python) and it quickly became my defacto scripting language though now I pretty much just use node since JavaScript is my day to day and I'm so familiar with the ecosystem.