A very simple example program Comparing Perl, Python and Java

From: Richard Monson-Haefel (rmh_at_burtongroup.com)
Date: 12/21/04


Date: Tue, 21 Dec 2004 15:29:33 -0700
To: <beginners@perl.org>

Hi,

 

I'm writing a paper comparing the use of Perl, Python and Java. My Perl
is pretty bad (as is my Python), so I thought I would check to see if
there is a more efficient way of doing it.

 

Here is the Perl program

http://www.rafb.net/paste/results/4px8PI74.html

 

 

If there is a more efficient, but readable way to write the script
(especially, it would see the first for loop which filters out names
longer than 4 characters) I would really appreciate it.

 

Here is the Java program

http://www.rafb.net/paste/results/4ayJvD89.html

 

 

 

Here is the same program in Python

http://www.rafb.net/paste/results/0duPmI65.html

 

 

Thanks,

 

Richard



Relevant Pages

  • Re: Why is lisp better than java perl or python or ruby?
    ... -A linux admin trying to decide what programming tools to learn ... Perl and Python are good at the first, Java is OK nowadays. ...
    (comp.lang.lisp)
  • Re: Why PHP is so succesfull?
    ... Hosting I have noticed that most of them supports only PHP as ... Or indeed if I could just use Java, I wouldn't have to learn anything ... recommend Python or Perl. ... Perl is easy to write, ...
    (comp.programming)
  • Soduku
    ... Here at my job, Python gets no respect. ... So he wrote a Python, perl, and Java version. ... it was running faster than ...
    (comp.lang.python)
  • Re: Paul Graham on Python hackers
    ... Java lacks asynchronous system calls and is thus unable ... unlike perl and python. ... that turns away decent hackers. ...
    (comp.lang.python)
  • Re: Soduku
    ... A programmer here wanted to see which language among Python, Perl, and ... So he wrote a Python, perl, and Java version. ...
    (comp.lang.python)