Exercises, examples and other material relating to training module P600. This module is presented on Private Courses
and Specially Run Courses
|Articles and tips on this subject||updated|
|4620||Perl 6 - a Practical Extraction and Reporting example!|
Always looking for an excuse to write little demo scripts - especially in Perl 6 which was new as an official release at Christmas, ... and had such an opportunity today. A datafile containing 2,500 records - station usage - and seeing how many were smaller in passenger numbers that Melksham in 2014 ...
|4611||Hungarian, Camel, Snake and Kebab - variable naming conventions|
In my program, I'm going to use a variable to hold the number of people (in a group or in a category) perhaps. What should I call that variable?
There are a whole lot of different conventions available to you - here are some I have used / come across
Camel case: numberOfPeople
A series of words, ...
|4610||Sorting by key or by comparator - Perl 6|
You can sort lists / arrays in Perl 6 - but unlike previous Perl versions, you only need to give a single key expression in your snippet of sort code, rather than instructions on how to compare two values. Of course, since Perl is still eclectic, the old way remains supported too!
Here is an example ...
|4609||Mapping an array / list without a loop - how to do it in Perl 6|
In Perl 6, you can use the >> operator to run a named piece of code (a subroutine) on each member of a list / array, returning to you a new list / array of transformed members. For example, the following code reads in all lines from a data file, splits them into individual records, and transforms each ...
|4608||Introspecion in Perl 6|
Perl 6 provides introspection - that's the ability for its object to be able to report on methods, attributes and inheritances.
And if you run Perl6 without an input file, it goes into a read - interpret - run cycle with each line you type in, rather like Python, Ruby and Tcl do. So we can experiment ...
|4607||Classes and object - first steps in Perl 6|
Perl 6 has a full object and class implementation ... first simple example [here]. Classes are defined with a class keyword, instance variables with a haskeyword, and methods with a method keyword. There's no "public", "protected", "private" wording, but subsidiary sigils (twigils) ... an extra "." ...
|4606||Using Perl 6 to analyse and report on data|
Within the last 24 hours I've got my hands on the first "official release" or Perl 6 - and I'm going to share with you the first practical program that I've written in the language.
Scenario - I have a data file listing the 2540 railway stations on the national network in the UK together with annual ...
|4605||Hello World - in Perl 6|
Perl 6 is both functional and object oriented - continuing its classic eclecticism from earlier versions of Perl. Which is great once you know it, but a bit frightening when you first come to learn it!
Programming courses start with a "hello world" example - no matter what langauge is being taught ...
|4604||Perl - version 6 - official version launched at Christmas|
We were promised Perl 6 "for Christmas" ... and the joke was "but we won't say which Christmas". That was rather longer ago than I care to remember, but the promise has been revived, and the punchline "Christmas 2015" has solved the riddle. Take a look at Perl 6 Intro - last updated 30th December 2015 ...
|2816||Intelligent Matching in Perl|
Is 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 the 10 is earlier than (i.e. less than) 8.
Is 14.0 the same as 14?
As a numeric value, yes it is. ...
|582||DWIM and AWWO|
"Do what I mean". One of the new buzzwords for Perl 6.
I first heard the new term "DWIM" mentioned some three or four years ago and it's a noble target. And I thought of it again last night as I was looking through hotel reviews and considering how we'll react to customer comments - indeed how we ...
Examples from our training material
Some modules are available for download
as a sample of our material or under an Open Training Notes License
for free download from [here]
Topics covered in this module
Perl was written in 1998, and many facilities date from that time with
added features over the years, right up to and including Perl 5. Perl 6
is a complete rewrite of the language, still using th eoriginal philosophies
and much of the original syntax, but with updates and additions to make it
a language fit for the future. The first official full release of Perl 6 was
December 2015, although many pre-realease / development / test versions have
been around. This moodule will be a series of examples of the application
of Perl 6 in various uses, and we'll be using them to help existing Perl users
learn about the differences and changes.
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule
Well House Consultants specialise in training courses in
. We run
throughout the UK (and beyond for longer courses), and
at our training centre in Melksham, Wiltshire, England.
It's surprisingly cost effective to come on our public courses -
even if you live in a different
country or continent to us
We have a technical library of over 700 books on the subjects on which we teach.
These books are available for reference at our training centre.