For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.
Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!
I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Well House Consultants
You are on the site of
Well House Consultants
Open Source Training Courses
hotel accommodation. You are welcome to browse and use
our resources subject to our copyright statement and to add in links from your pages to ours.
Other subject areas - resources
Well House Manor Resources
Object Orientation and General topics
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
C and C++ Resources
Web and Intranet Resources
Perl module P301
Variables in Perl
Exercises, examples and other material relating to training module P301. This topic is presented on public course Perl for Larger Projects
Perl variables come in seven types. You should be familiar with scalars, lists and hashes before you start this module, but you've probably still got more to learn. And how about code variables, file handles and typeglobs?
|Articles and tips on this subject
|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 ...
|Accessing variables across subroutine boundaries - Perl, Python, Java and Tcl
In a perfect programming world, code is broken into named blocks (methods, functions, subroutines, classes, procedures, commands, modules, packages etc) and data is passed around between the blocks purely as parameters and return values. And variables are local to the block in which they're used. This ...
|Sigils - the characters on the start of variable names in Perl, Ruby and Fortran
A sigil (from Latin sigillum "seal") is a symbol created for a specific magical purpose. A sigil is usually made up of a complex combination of several specific symbols or geometric figures, each with a specific meaning or intent. In computer programming, a sigil is a special symbol attached to a variable ...
|Object Orientation in an hour and other Perl Lectures
I enjoy the occasional course that's different in its design and specification, and yesterday was one of those - more lectures that training, on intermediate and advanced Perl, for a group of eight delegates who were all well experienced at PHP, but Perl "dabblers" to this point. During the day, we ...
|Some more advanced Perl examples from a recent course
I ran an extra Perl for larger projects course, single company, at the tail end of last week and into the weekend (the only gap in my diary for a few weeks!) and - as is often the case on single-company courses - I wrote some new illustrative code to show specific subjects that came up in a different ...
|Further more advanced Perl examples
I'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 previous examples. If you read a comment below and thing "that's what I'm looking for an example of", ...
|Variable Types in Perl
In Perl, you have "autovivification" where variables are created when they have a values set in them, without the need to declare them. Some authorities will tell you that they are also "autotyped" in that Perl knows what to store in them automatically too, and to some extent that's true ... but the ...
|Lead characters on Perl variable names
Perl 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 last not being terribly common).
@ for a list - that's an ordered collection of scalars, indexed from ...
|Perl references - $$var and \$var notations
In Perl, if I write:
$stuff = "Porridge";
then I'm setting up a variable to contain the value "Porridge".
If I write:
$stuffat = \$stuff;
then I'm setting up a variable to contain the ADDRESS OF the variable $stuff.
So if $stuff was in memory at (hex)fe80 ... then $stuffat will be assigned that value ...
|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 lvalues are simple variables or array / list / hash / dictionary members ... for example
$hello = "Hello ...
|Answering ALL the delegate's Perl questions
During courses, questions arise. "I'll get back to that" could make people feel that I'm brushing something off ... except that I explain, early on, that some questions require a great deal of background knowledge to be answered sensibly. And I keep a list of topics that I'll be getting back to ...
Examples from our training material
| What variables have I used?
| delete, undef, defined and exists
| recursion in Perl
| Typeglob - one each of file handle, scalar, hash and list
| Variable types
| my, local and global variables
| Anonymous lists using [ and ]
| Pascal's triangle; clever use of formatting
| scoping with "my"
| Scoping of our and my variables
| persistent my variable
| data munging - unpack, splice, regular expressions etc
| Modifying values passed in to a subroutine
| handling a list of lists element by element, by row, and as a whole
| ref function - what is in a scalar
| variable scope illustration
| Beware of variable scope in recursive code
| Use of strict to flag scoping dangers
| Using package names to supress strict warnings
| select and typeglobs for file handles - alternative to array of file handles
| Accessing Perl's symbol tables
| Dumping out all variables defined
| typeglobs - a package deal (one of everything!)
| Setting up and exercising a typeglob
| 6 variable types in Perl
| Soft References
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
undef and delete.
Further examples using my variables.
Using a reference within a subroutine.
Dynamic creation of structures.
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.