6 ms·
Would I be nuts to pick perl over python as my main scripting/server admin language? I am a postgres, openbsd, data/text processing guy. OpenBSD is 40% perl. P
by elchief 11y ago
Would I be nuts to pick perl over python as my main scripting/server admin language? I am a postgres, openbsd, data/text processing guy.
OpenBSD is 40% perl. Postgres uses perl for its builds. Perl seems to have better text processing capabilities. But it seems to be dying out compared to python.
- eCa 11y agoNo. Pick the one most suited to your brain/task.
- colechristensen 11y agoYou would be reasonable. Perl often fits in better with the 'advanced shell scripting' type of work than Python or Ruby. It has more libraries for unix-like admin tasks, but less common support for external APIs (which more commonly support Java/Ruby/Python/etc.) so it may be an uphill battle if you use a _lot_ of external APIs. Perl won't ever 'die out', especially if you write good perl that doesn't depend on flashy popularity-train things. It's far too ingrained in many unix derivatives. If you're a server admin, you're missing out if you don't know perl. Choosing perl might be a little less common today, but it's totally reasonable if you want it.
- Diederich 11y ago> but less common support for external APIs (which more commonly support Java/Ruby/Python/etc.) Yesterday, there were an even 60 CPAN module releases, and that is a pretty typical day. Most of them weren't NEW modules, but some were. It's true that you don't as often see Perl APIs released along with the various 'external API' things, but, as someone who probably spends too much time tracking the various new hot things, Perl API support is first rate. It's damn rare that I don't see a Perl API for something, even if it's relatively new. I'be been watching CPAN for a long, long time, and I will say that it's more vibrant and active now than I have ever seen it.
- merrilymeredith 11y agoThey're both very easy, fun languages, and decent fluency in one will give you a good foundation to get into the other. And going beyond roll-your-own server admin stuff, I do enjoy both Rex (perl) and Ansible (python). I don't have an off-the-cuff rec for a python book, but Modern Perl (2014) by chromatic is available online, isn't very long, and should give you a chance to test the waters and decide if that's the way you'd like to go.
- elchief 11y agoYa, Rex is great.
- brudgers 11y agoPerl coders almost certainly tend to skew older than the Python population, if for no other reason than Python is more likely to be taught today and more people are learning programming than twenty years ago. And younger people tend to be louder and more enthusiastic while older people tend to be more tool-for-the-job oriented. That said, it's not clear what you mean by "picking Perl". Adopting Perl 5 is a distinctly different choice than adopting Perl 6. Considering them as separate languages may be a useful, even if dubious, abstraction.
- collyw 11y agoI disagree. I do mainly Python / Django stuff these days, but if I have some syadmin type tasks, I will happily switch to Perl. It has better build in syntax for quick stuff, like renaming a bunch of files. Built in regexes are so much easier than farting about with object based regexes. Text processing is better. Stuff like file gobbing is built into the language. Its easier to shoot yourself in the foot with Perl, so I'll choose Python for stuff that is more long term. It really depends what you want to do.
- digitalzombie 11y agoSeems like it's dying out. For Puppet, Chef and other stuff it's Ruby. Python ate most of it's share in biogenetic. Php took over Perl in web dev. Python is much more readable in general imo. Plus whoever taking over your script may have to maintain it and they're most likely to know Python than Perl (if you're looking at language popularity). The counter argument is that any good programmer can pick up languages but there is a down time still.
- antod 11y agoWith my sysadmin hat on I do have a bias towards scripting languages that ship with the OS. Not increasing the OS/distro footprint is one of my 'things'. I lean more towards Python these days because of tools like SaltStack and Ansible and great library support, and because it fits my brain better. So with Linux, I'd probably recommend Python as it is a key part of most distros (like Perl still is too, but eg Ruby isn't). But on OpenBSD Python isn't a key builtin part of the OS while Perl is, so I'd still recommend Perl for an OpenBSD admin.
- xorcist 11y agoSure. CPAN is (still) better curated than PyPI, with better testing coverage, and that's important for many common use cases.
- pjmlp 11y agoIt depends where you intend to work, most commercial UNIX systems (Aix, ...) are more likely to have Perl than Python installed.