Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
New to programming. Portable code. Perl or Java?

Historically, programs have been operating system dependent with a distribution that runs on (say) Windows NT not being suitable for use on Solaris. Or, in current operating systems, an XP distribution being unsuitable for Linux or OS X.

This has changed somewhat with more modern languages such as Java and Perl, but the "model" of how this works - and thus the ideal application - differs between the two.


Java code runs in a virtual machine - a piece of software that is operating system dependent which provides an environment in which a system independent distribution can run. You'll need to install a "JRE" (Java Runtime environment) that includes this virtual machine on any system on which you want to run Java, or use a JVM that's supplied as part of something else such as certain browsers before you can run Java on a computer.

Java provides device independence by working at a level above the operating system, so it is NOT an ideal language for system admin, backup scripts and similar utilities. It's great for larger "OO" projects that run for months or years, with teams of programmers working together.

Perl can run on all major operating systems. In order for a Perl script to run on a computer, a version of Perl specific for the operating system must be installed (just like Java needs a JRE). Once Perl is installed, the same distributions should be able to run on any platform if the code was written suitably.

The vast majority of Perl code *is* portable. I've quite happily written code without even thinking about the target OS, and all our training examples work on Windows, Linux, OS X and Solaris quite cheerfully. In practice, Perl is very "Unix like", but where something's required that is of necessity operating system dependent, the Windows implementation (for example) mimics the Unix behaviour and does what we describe as the "moral equivalent". In that way, Perl code will typically run cross platform in a far wider range of applications than Java which simply cannot do certain things practically.

A warning - it IS possible to write operating system dependent Perl; if you say "run the following OS command" and ask it to run something that doesn't exist on some OS, then it's bound to fail. But Perl scripts aren't accidentally written like this, and can check.


Yes, and knowledge gained of one will make learning the second easier. We're quite used to running "learning to program in Perl" and "learning to program in Java" courses - and the way we teach newcomers to programming is different to the way we teach people who are converting from other languages.

Having said that, both Perl and Java have a huge range of facilities and neither is the easiest of languages for the newcomer ... but then you end up being able to do really useful, portable things after your course.


You'll see a lot more information around about Java and you'll feel that it's a much more popular language. It probably does have a bigger user base (see my comments earlier about how great it is for huge applications), but it's also been very much over sold by its originators who push it perhaps wider than they should.

Perl is an Open Source language. It's not really sold but has enthusiastic advocates who, however, will tell you its strengths and also its weaknesses - they have no income to make from overselling it. Thus it's a bit of a "hidden secret" compared to Java.

See also Courses for newcomers to programming

Please note that articles in this section of our web site were current and correct to the best of our ability when published, but by the nature of our business may go out of date quite quickly. The quoting of a price, contract term or any other information in this area of our website is NOT an offer to supply now on those terms - please check back via our main web site

Related Material

Web Application Deployment - The Components of a Web-Based Solution
  [3891] The components of an Apache httpd / Tomcat / MySQL stack and what each does - (2012-10-13)
  [2896] LAMP - Linux, Apache, MySQL, PHP - install, configure, administer - (2010-07-30)
  [2099] Should I maintain the programming code on my own website? - (2009-03-23)
  [1496] PHP / Web 2 logging - (2008-01-06)
  [1265] Apache, Tomcat, Jakarta, httpd, web server - what are they? - (2007-07-13)
  [1198] From Web to Web 2 - (2007-05-21)
  [1176] A pu that got me into trouble - (2007-05-04)
  [924] The LAMP Cookbook - Linux, Apache, MySQL, PHP / Perl - (2006-11-13)
  [673] Helicopter views and tartans - (2006-04-06)
  [510] Dynamic Web presence - next generation web site - (2005-11-29)
  [442] How far away is that server? - (2005-09-10)
  [433] FTP - how to make the right transfers - (2005-09-01)
  [367] Ajax - (2005-07-03)
  [166] Acronyms - (2005-01-02)
  [49] Business is the predominant user of Tomcat, Perl and Tcl - (2004-09-15)
  [34] Linux / LAMP course - (2004-08-31)

Choosing your language
  [3785] Programming languages - what are the differences between them? - (2012-06-27)
  [3764] Shell, Awk, Perl of Python? - (2012-06-14)
  [3619] Ruby v Perl - a comparison example - (2012-02-21)
  [3558] Python or Lua - which should I use / learn? - (2011-12-21)
  [3169] Rekeying a table - comparison in #Ruby #Perl and #Python - (2011-02-14)
  [2866] Ruby - how does it compare and where is it the right language? - (2010-07-11)
  [2700] The same very simple program in many different programming languages - (2010-03-31)
  [2536] All the Cs ... and Java too - (2009-12-13)
  [2535] When should I use Java, Perl, PHP, or Python? - (2009-12-13)
  [2507] Admission - (2009-11-19)
  [2048] Learning to program in PHP, Python, Java or Lua ... - (2009-02-19)
  [2001] I have not programmed before, and need to learn - (2009-01-19)
  [1990] Speaking all the languages - (2009-01-12)
  [76] Learning to program in - (2004-10-07)

Web Application Deployment - Java - Basic Language Overview
  [2423] What is a JVM, a JRE, a JDK - components of the core Java Environment - (2009-09-26)
  [2120] Java on the Web Server - course for delegates with some prior Java experience - (2009-04-06)
  [871] Java oversold? - (2006-09-19)
  [659] Web Application Components - (2006-03-28)

Perl - Introduction
  [2832] Are you learning Perl? Some more examples for you! - (2010-06-27)
  [2812] What is Perl? - (2010-06-15)
  [2070] Converting to Perl - the sort of programs you will write - (2009-03-08)
  [1852] Perl and Blackberries - (2008-10-23)
  [1753] Perl v PHP, choosing the right language - (2008-08-14)
  [1717] Q - Should I use Perl or Python? - (2008-07-23)
  [924] The LAMP Cookbook - Linux, Apache, MySQL, PHP / Perl - (2006-11-13)
  [846] Is Perl being replaced by PHP and Python? - (2006-08-27)
  [743] How to debug a Perl program - (2006-06-04)
  [691] Testing you Perl / PHP / MySQL / Tcl knowledge - (2006-04-19)
  [629] Choosing the right language - (2006-03-01)
  [604] Perl - multiprocess applications - (2006-02-13)
  [594] Twice is a co-incidence and three times is a pattern - (2006-02-07)
  [577] Learning to program in Perl or PHP - (2006-01-26)
  [382] Central London Courses - Perl, PHP, Python, Tcl, MySQL - (2005-07-18)
  [317] Programming languages - a comparison - (2005-05-20)
  [25] Release numbers - (2004-08-23)

resource index - Deployment
Solutions centre home page

You'll find shorter technical items at The Horse's Mouth and delegate's questions answered at the Opentalk forum.

At Well House Consultants, we provide training courses on subjects such as Ruby, Lua, Perl, Python, Linux, C, C++, Tcl/Tk, Tomcat, PHP and MySQL. We're asked (and answer) many questions, and answers to those which are of general interest are published in this area of our site.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2019: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/solutions/general- ... -java.html • PAGE BUILT: Wed Mar 28 07:47:11 2012 • BUILD SYSTEM: wizard