Training, Open Source computer languages

PerlPythonMySQLTclRubyC & C++LuaJavaTomcatPHPhttpdLinux

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Quiz Page perl
The perl quiz has changed! We have replaced perl questions with answers! And from those answers you'll find further links to even more information - forums where you can ask questions, training courses, longer articles, and more. [link to quiz index] ... If you really want the old quiz questions, you can find them here, here, here and here ... and with onward links to the possible answers to each question too.

Progress Bar Techniques - Perl
Have you ever sat there and wondered "is this program nearly done ... is it still running ... how is it getting on" and wished you had a progress bar. But then have you ever watched a jerky progress ...

Perl Socket Programming Examples
It's always a pleasure to run private courses - for when a questions that's a little bit away from the normal comes up, I can take time to provide a full answer and demonstration without fear of ...

Out of memory during array extend - Perl
Use a hash if you want a sparse list in Perl! If you set up a list in Perl and don't fill all the members from zero up, that's OK but all the missing elements will actually use up some memory as ...

Ruby, Perl, Linux, MySQL - some training notes
We have just come to the end of a solid 12 days of training ... and we are just getting ready for the next week, with delegates arriving this evening. There's a lot going on behind the scenes, even ...

Debugging and Data::Dumper in Perl
I'll admit it - I'm not a great fan of debuggers, preferring to write well structured code, and check it out with a few test / intermediate print statements. You'll often find I code: ...

Object Oriented Perl - First Steps
There are some occasions when a new example that I write / a topic that comes up on a course results in an article that's so long that it doesn't fit into the Blog / short article format, but requires ...

About dieing and exiting in Perl
If you want to end a program in Perl, you can get out quickly enough with an exit function call. But that's probably just a part of what you'll be wanting to do - you'll be wanting to generate an ...

Reactive (dynamic) formatting in Perl
If you want to format your data neatly in columns, you can use sprintf or printf to do so if you're using a fixed width font. A format of "%20s", for example, calls for a string that's 20 characters ...

Seven new intermediate Perl examples
From the "learning to program in Perl" course I'm running this week, I am pleased to present seven new examples ... written during the course, in front of the delegates, to show them NOT ONLY how the ...

Well structured coding in Perl
Write a small code utility - a few lines - and you can simply start at the top and work through to the bottom. But as the code increases in length, you're going to want to take out common code and put ...

Perl and Blackberries
"Of course people will use Perl - it's free". No - whilst Perl is freely distributed [under license], that's not the sole reason that people use it. Blackberries, growing in profusion on the roadside ...

String matching in Perl with Regular Expressions
Some languages used adaptive or overridden operator to perform a task depending on the operands - for example in Java, the "+" operator adds numbers, but concatenates strings, and in PHP the == ...

Formatting with a leading + / Lua and Perl
In formatted printing, you can often use a leading "+" in the format string to force a positive sign to be added in front of positive numbers - for example "%+4d" means an integer, to base 10, 4 ...

Processing all files in a directory - Perl
From this week's Perl course: opendir(DH, "."); while ($igot = readdir(DH)) {   next if ($igot =~ /^\.{1,2}$/);   print "igot $igot\n"; } You'll notice that I have used a regular ...

Dont bother to write a Perl program
I can - very easily - write a Perl program to process every line of an incoming data file - indeed, that's much of where Perl originated as the "Practical Extraction and Reporting Language" Here's a ...

Perl - map to process every member of a list (array)
Perl's map function (like array_walk in PHP) allows you to do something to every member of a list - thus it often saves you the need to write a loop into your Perl, saves the Perl runtime going back ...

Perl - Subs, Chop v Chomp, => v ,
During courses, I end up writing a lot of short demonstrations to show particular features of a language - this week, it's a Perl Programming Course so those examples are in Perl. Some interesting ...

Question Mark - Colon operator (Perl and PHP)
The ? and : operator in Perl and PHP allows you to write a single statement that's both an if and an else without the need for all the clutter of keywords, extra variables, and so on if all you want ...

libwww-perl and Indy Library in your server logs?
Here are some sample lines from our server logs ... and I don't like the look of them! from 195.39.5.203 - Moravskoslezsky Kraj, Czech Republic [1000 miles] - libwww-perl/5.805 .net: ...

Calling procs in Tcl and how it compares to Perl
In languages such as Java, you must call your named blocks of code (methods) with the correct number and type of parameters, but in Perl you may call them with as many or as few parameters as you like ...

Perl v PHP, choosing the right language
"Should I use Perl or PHP?" - a question asked today about a heavy data processing application, but by a delegate who's main work is web site stuff and who is here on a PHP course ... with some prior ...

Finding words and work boundaries (MySQL, Perl, PHP)
If you're searching for the word "mile", you probably don't want the page that tells you that Sally Smiled at Harry. But you may want to find a Milestone, even if it is within quotes. Regular ...

A short Perl example
#!/usr/bin/perl -pa $_ = "$F[0] $F[-2]\n"; What does that Perl code do? Although it's very short, it's also somewhat obscure, and my delegates yesterday were not at all sure that they would wish to ...

Equality and looks like tests - Perl
Whenever you do an equality check in a Perl program, you must think whether you're checking if two numbers are equal, if two test strings are equal, or if a string looks like a pattern. And you write ...

Hot Courses - Perl
It feels like a heatwave! Or rather "summer has come to the UK". We were doing some sums on today's private course in East Anglia, which is running at the customer's office with some 16 delegates ...

Perl 6 - When will we have a production release?
The "Perl 6" project was announced some years back now, with the philosophy of "right rather than rushed" and the comment "you'll have it for Christmas, but we won't tell you which Christmas". It's ...

Q - Should I use Perl or Python?
An interesting question posed to me today - and not for the first time. And not for the first time, my answer had to be "tell me more about your application, and about the people who will be writing ...

There is more that one way - Perl
"There are six ways of doing anything in Perl." So say I on Perl courses and just occasionally I come up with an example that proves it. This one doesn't quite - I show you just five ways of finding ...

Environment variables in Perl / use Env
If I say use Env;, Perl loads in a module which allows me to access all my environment variables directly within my code, by name. If I add an explicit list of variable names as a list to the module, ...

Finding operating system settings in Perl
In Perl, you have a variety of special variables available to you ... preloaded with information in many cases. Some of their names are "special" such as $^O, $^T, $", $/, $! or $_, and others are ...

Perl ... adding to a list - end, middle, start
You can add an extra element on to a Perl list with push, into the middle with splice and onto the beginning with unshift. You can extract a single element from splitting a scalar and calling up the ...

Running operating system commands in Perl
Perl is excellent "glueware" - a language which can be well used to connect together a whole lot of elements. And one of those elements may be operating system commands run from within the Perl ...

Saying NOT in Perl, PHP, Python, Lua ...
"Isn't there one standard way to say NOT?" asked one of my delegates on today's course - and it's an excellent question. But the answer to a question about a negative subject is itself in the negative ...

Factory method example - Perl
Utility methods (factorys) are often used to create objects which may be of any of one of a series of different classes, depending on the data passed in. Have a look at this Perl program which ...

Example of OO in Perl
Although Perl 5 doesn't use the words "class", "method" or "object" (or any of the other common OO words), it never the less has a very good OO model indeed - here's the source code of an example, ...

Changing a screen saver from a web page (PHP, Perl, OSX)
Here's a challenge. I want to change the screen saver on a mac mini, running OSX, from a browser anywhere in the world. You may well ask why ... the screen of the mac mini is to be visible at Well ...

Underlining in Perl and Python - the x and * operator in use
Perl's x operator - yes, that is the letter x - is used to replicate the string on the left the number of times given to the right. "What use is THAT" I have been asked in the past, by delegates ...

Learning to program in Perl
For the last few days, I've been teaching Learning to Program in Perl. Unlike a conventional course style, for this one I had been asked to assume no prior programming knowledge, and covered first ...

Cambidge - Tcl, Expect and Perl courses
By an amazing co-incidence, I'm in Cambridge this week ... running two 2.5 day Tcl and Expect courses, then back just across the road next week running two 2 day Perl introduction courses of the ...

What is an lvalue? (Perl, C)
An lvalue is an expression that you can write on the left hand side of an assignment statement - in other words an expression that defines a specific memory address of a variable. The most common ...



See also:

© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 0800 043 8225 or 01225 708225 • FAX: 0845 8382 405 or 01225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho