Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why should I use Perl instead of Ruby/Python/etc? [closed]

Tags:

perl

I love Ruby and have been using it for a few years to handle day-to-day scripting tasks. Lately however, I've had a number of people tell me that Perl is where it's at. I have nothing against Perl, but it seems like it's kind of fallen behind the times a bit.

However, that's probably just my perception, so I'm asking all of you, what makes Perl so great? I'm genuinely seeking information here; I'd like to understand why this language has such ardent followers.

like image 357
NateD Avatar asked Jan 19 '11 20:01

NateD


People also ask

Which is better Perl or Ruby?

It is a pure and highly Object-Oriented language. The number of libraries present in Perl is less than Ruby. The number of libraries present in Ruby is more than comparing to Perl. Its support for Unicode is much stronger than Ruby.

Why do people still use Perl?

Why it is still relevant in 2022. Perl is not going away even if it tends to be less trendy than other modern languages. It is used in production codebases of many companies, for tasks as diverse as web development, databases access, log analysis or web crawling. It is a core component of most unix-like systems.

Why is Perl used over Python?

Answer: Python and Perl are high-level programming languages that were invented to serve different purposes. Perl was developed by Larry Wall as a Unix-based scripting language for making reports easily. Whereas Python was developed to offer code readability to its users for writing small and large programs.

What is better Perl or Python?

Perl is a high-level programming language that's easier to learn when compared with Python. Python is more robust, scalable, and stable when compared to Perl. While Perl code can be messy, featuring many paths to accomplish the same goal, Python is clean and streamlined.


3 Answers

I know a good handful of hackers who left Perl to go to Ruby. Python is obviously a nice language too. I am neither saying nor implying anything against either.

Pros for Perl 5

  • Since about 2005 or so Perl has been in a fairly dramatic renaissance in both CPAN and core releases. Perl 6 has helped drive this by sending concepts like role-oriented OO back. Strawberry Perl has made Perl hacking on Windows more like *nix.
  • The CPAN is huge, still growing, and most of the more widely used authors/teams are responsive to bugfixes. Most popular Perl modules are tested widely and well. CPAN testers recently sent their 10 millionth test report.
  • Many of the big kits have good communities associated where expert help is available quickly.
  • The tool chain has become very flexible.
    • The combination of perlbrew, local::lib, and cpanminus lets users (even without root) have an arbitrary number of perl versions and libraries accessible on the same box.
  • Many of things that Java, Ruby, Python do right come back to Perl and with facility. For example–
    • KinoSearch is Lucene but even faster by some benchmarks.
    • Catalyst is Rails but more flexible. It’s a completely agnostic C with regards to the M and V.
    • Plack is Python’s WSGI + Ruby’s Rack.
  • It’s as fast and personal or readable and robust as you want it to be.
    • A short one-liner can edit every HTML file in your tree when you’re in a hurry to fix something.
    • A clear and robust program with error reporting, logging, and feedback built on any of the 6 or 7 suitable HTML/XML packages could do the same for a client.
  • Perlmonks. Though there are notable exceptions, the Perl community is generally friendly, helpful, and positive.
  • There are quite a few good Perl jobs waiting to be filled. The back and forth between the high level languages has left oodles of Perl in the wild without a matching crop of Perl-centric devs. (I get 5-7 cold calls from recruiters a year.)
  • It’s fun. In quotes: “Perl has the happiest users.” I can’t speak to the scientific nature of that but I can say I only program today because Perl exists. Many other Perl hackers share this stupid giddiness for the language.

Keep in mind it’s not a zero sum game. The more languages you can wield, the better.

like image 179
Ashley Avatar answered Oct 05 '22 12:10

Ashley


If I had to name one great strength of Perl, it's one word: CPAN.

Having worked with Ruby as well, I'd not say that Perl is necessarily better or worse, but definitely more mature. It is, after all, much older. However, it's not decrepit. It has plenty of modern stuff, e.g., Moose and the 5.10 and 5.12 updates have fixed a lot of problems that the ancient 5.0.x had.

(And if you're wondering: Perl 5 and Perl 6 are different languages. The similar name is an unfortunate mistake. Though Perl 5 does borrow ideas from Perl 6 and vice versa.)

like image 39
derobert Avatar answered Oct 05 '22 14:10

derobert


CPAN.

The syntax of Perl is sometimes painful to look at but it is available on Unix machines everywhere and with the command line access to the huge number of packages in CPAN (which can also be accessed via browser), Perl is the de facto standard because of its broad applicability and availability.

like image 42
Spaceghost Avatar answered Oct 05 '22 14:10

Spaceghost