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.
Alternative loops and conditionals in Ruby and PerlRuby gets a lot from Perl - including its eclecticness in having a wide variety of alternative ways of doing similar things - and no more so than in loops and conditionals. Not only do you have an ...
Further more advanced Perl examplesI've uploaded a further batch of new examples (that makes around 40 in total!) from the private Perl course that I ran from Wednesday through Saturday last week - many of them adding a new twist on to ...
Different perl examples - some corners I rarely exploreThe private Perl course that I ran on Wednesday through Friday of last week was a little out of the ordinary as we were concentrating far more that usual on a wide variety of practices that may be ...
Unpacking a Perl string into a listIn Perl, you can extract data from a string in a lot of different ways. You can split the string if you want to use a uniform separator, you can use a regular expression if you want to grab out bits ...
Perl - the duplicate key problem explained, and solutions offeredDo you want to hold data in a hash in Perl - but you can't do so directly because you have more than one piece of data that should have the same key?
The problem ...
while (<DIAL>) { ...
Teaching examples in Perl - third and final partThree part article ... this is part 3. Jump back to part [1] [2]
Following on from two earlier posts, here is the final third of the new examples that I wrote during last week's Perl course, and to ...
Fresh Perl Teaching Examples - part 2 of 3Three part article ... this is part 2. Jump to part [1] or [3]
Perl is the most tremendously powerful and fully featured langauge - you've probably seen that from the first set of sample programs ...
Are you learning Perl? Some more examples for you!One of the things that you'll get on a Well House Consultants course is new code written by the tutor in front of your very eyes. We do that because:
• you need to learn not only how code ...
Perl course - is it tailored to Linux, or Microsoft Windows?Sharing an answer to a customer enquiry ...
Q: Is the course tailored to Linux operating system?
A: "Yes and no" is probably the best short answer I can give :-/
Perl is an extremely portable ...
Chancellor George Osborne inspires Perl ProgramFrom today's budget speech ...
$oldvat = 1.175;
$newvat = 1.2;
printf ("%8s %8s %8s\n","net","old","new");
for ($amount=60; $amount<90; $amount++) {
next if ($amount%2 and ...
File open and read in Perl - modernisationSome updates on file opening and reading in Perl ...
1. The original open function was good, but technically questionable in that the second parameter includes (as a single string) both the name of ...
Setting a safety net or fallback value in PerlLet's say that you want a Perl variable to contain a result which varies depending in the type and values of data fed in. Easy enough - but you need to think about what value you want it to hold if ...
Intelligent Matching in PerlIs 10 greater than 8?
As a number, yes it is ... but if you're comparing character strings and you would for a book's index, then the character "1" comes before the character "8", so in this context ...
switch and case, or given and when in PerlThere's a lot of well established Perl code running in many places, using versions of the language that have been used for years. But the language should not stand still, and so extra features get ...
Iterating over a Perl list and changing all itemsYou can loop through a list (we're supposed to call them "lists" not "arrays" in Perl these days!) using a foreach loop running a counter, or using the second form of foreach that doesn't provide a ...
What is Perl?An Experiment ....
Perl is a computer language.
You write a series of instructions and the computer then performs them. Unless you state otherwise, statements are performed in order. You can, ...
After the Perl course in Nurnberg
The human body is a very efficient heater ... and it's surprising just how much heat is put out by equipment such as laptop computers. So the last three days in Nuremberg, training a group of ...
Binary data handling with unpack in PerlDuring today's Perl course, I was asked to provide an example of the unpack function for extracting multiple values from a piece of data - typically binary data extracted from a file into a scalar ...
Perl - skip the classics and use regular expressionsPerl includes a number of "classic" string handling functions - things like index to find one string in another and substr to get a substring. But you very rarely need to use them because the other ...
The Perl SurveyWell House Consultants - as an independent training company - was founded on a bedrock of Perl. But there days, Perl is only one of a number of subjects we teach, and it's far from "The big cheese" ...
Perl Course FAQWe run public Perl courses every 2 or 3 months at our Melksham, Wiltshire training centre, and private courses on site at customer offices at about the same frequency. Private Perl courses are ...
For loop - checked once, or evety time? Ruby v Perl comparison and contrastAlthough may aspects of Ruby are inherited (in a non-OO way!) from Perl, there are some distinct differences too; a classic for loop in Perl has its end condition checked every time around the loop, ...
Want to do a big batch edit? Nothing beats Perl!I still love Perl ...
Wanting to convert a file of lines like this:
<img src=rp_153_track.jpg><br><br>
into lines like this:
rp_153_track.jpg <img ...
Moving the product forward - ours, and MySQL, Perl, PHP and Python tooI have just posted a "steady as she goes" message, welcoming the new decade but reassuring our customers that we're carrying on offering very much the same high quality courses, and the same high ...
Perl and the Common Gateway Interface - out of fashion but still very useful?Is the Common Gateway Interface dead? No - it isn't; although my first choice for a new web application these days would be something else (PHP, Java with Servlets, JSPs or a derivative, Python with ...
When should I use Java, Perl, PHP, or Python?Java is a good language for bigger systems ... teams of programmers writing bits of code that interact with each other. In fact, Java is so well tuned towards the bigger systems that it's not the ...
Making executable binaries in Python (or Perl)In a nutshell, translations of any of the scripting / semi-scripting languages into executables require the libraries that are included with the base distribution to be included with them, so they ...
Variable storage - Perl, Tcl and Python comparedFrom Monday to Wednesday, I was teaching Python to a group of delegates at a company where I have previously taught Tcl and Expect and Perl. And this interesting diagram shows just what a contrast ...
Operator overloading - redefining addition and other Perl tricksWhat does addition actually mean? It means different things depending on what you're adding together, and in Perl you can redefine additions - and other operators - on objects of types which you ...
But I am reading from a file - no need to prompt (Perl)If you're writing a script that calls for user input, you had better prompt the user ... otherwise, the terminal / window will appear to hang and the user won't know what's going on. However - if ...
Automated Browsing in PerlI'm reminded on today's Perl course just how powerful some of the modules are, and how much you can do in so little code.
LWP::UserAgent turns your Perl into an automated browser .. the following ...
Firefighting with PerlIf the building is blazing, you'll go right ahead and put the fire out with the extinguisher. Hopefully you'll have been trained to use the right sort of extinguisher on the right fire, but you won't ...
Giving up on user input - keyboard timeout in PerlThere's an old piece of code that I've used to demontstrate how (in Perl) you can prompt for a user input ... but then time out the input on an alarm signal if the user doesn't enter data within a ...
Making variables persistant, pretending a database is a variable and other Perl tricksHave a look at this Perl program:
use fyle;
tie $counter,"fyle";
$counter = $counter + 1;
print ("This is access no. $counter\n");
Apart from the rather curious module loaded at the top, this ...
Handling XML in Perl - introduction and early examplesThere are hundreds of modules (literally) in Perl for handing XML. Some of them are highly specialised, but others are of much more general use in reading (and in some cases writing) XML streams.
...
Long job - progress bar techniques (Perl)Here's a "Perl for Larger Projects" example --- for use in illustrating the "advanced file and directory handling" and "handling huge data set" modules.
Scenario ... I want to go through all the ...
Designing your data structures for a robust Perl applicationWhatever language you're programming in, design of your data structures is important. You should consider such design ahead of time, and before you start to code - "What am I going to be doing with ...
Lead characters on Perl variable namesPerl variable names mostly start with a special character:
$ for a scalar variable - that's a variable that can hold an integer, a float, a string, a reference, or a compiled regular expression (that ...
Ternary operators alternatives - Perl and Lua lazy operators"If the gender is male, the answer is him, but if the gender is female, the answer is her". A common situation in programming - [is/are], [him/her], [yes/no], [child/children], [ice/water/steam], ...
Uploading and Downloading files - changing names (Perl and PHP)When you are uploading a file to a server via http (in Perl or PHP), where is the file saved, and what is it called? And when you download a file, where is it saved on your local disc, and what name ...
|
|