Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use Perl or PHP or something else for this project?

I'm about to embark on a project that will need to:

  • Process XML
  • Heavy text parsing of non-xml documents
  • Insertion of data from xml and non-xml documents into a relational DB.
  • Present processed data to user from db using webpages.
  • Must handle load very well.

The website will be subject to short periods of very heavy loads to pages (300+ visitors a minute for several minutes), but most of the time will be idle (a dozen or so visitors a minute).

I have a very strong background in Java and web services, but I do not want to use Java for this project as I'd like to diversify my skill set.

I'm not looking for your opinion on which language you think is best. What are some pros and cons from using these languages that you might recognize from your own experiences?

like image 498
Clinton Avatar asked Mar 29 '10 14:03

Clinton


People also ask

Is Perl better than PHP?

And the winner is... Both PHP and Perl are excellent languages, with a rich history and excellent community support. But PHP is often the go-to language of the two, being used by over 78% of websites with a known server-side programming language for good reason.

Is Perl still used in 2022?

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.

Is Perl faster than PHP?

PHP is generally considered to be faster than Perl, although this is debatable. In any case there are certainly ways to make Perl perform as fast. PHP supporters often cite speed as a good reason to choose PHP, but in reality it is not normally a concern and any differences are usually academic.

What is a major difference between Perl and PHP?

Perl is an object-oriented, useful, Multi-paradigm, intelligent, procedural, basic and event-driven programming dialect. PHP is a Basic, intelligent, object-oriented, utilitarian and procedural programming dialect. It was authorized beneath Imaginative Permit GNU Common Open Permit.


2 Answers

I'd go with Perl. The LibXML series of modules gives a variety of interfaces (DOM, XPath, XSLT, etc.) backed by a fast C parser.

Perl's regex support for slicing and dicing text is pretty much unmatched by any other language. If you expect to do lots of arbitrary text processing, and are at least a little familiar with regex, you will thank yourself.

There are also a series of great web frameworks for Perl, including the simple but powerful Mojolicious framework, and the comprehensive Catalyst framework. There's always the ancient and stable CGI library, but Mojolicious or Catalyst would probably be better choices.

like image 131
2 revs, 2 users 50% Avatar answered Oct 03 '22 07:10

2 revs, 2 users 50%


Since I'm a PHP guy, here is what I can offer about PHP

  • PHP scales well due to it's shared nothing architecture
  • PHP has native support for various XML libs
  • PHP has native support for a number of RDBMS
  • PHP has native support for caching
  • PHP has native support for webservices
  • PHP is a templating engine

So the requirements to a language from your question are met by PHP.

However, Perl, Python or Ruby or even ServerSide JavaScript (...) should all be capable of doing what you are asking for either. PHP has it's quirks, so do the other languages. If you are a Java Guy, you might like Ruby for it's syntax, but then again, only you can decide.

like image 28
Gordon Avatar answered Oct 03 '22 08:10

Gordon