Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
For 2023 - 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 who provide Open Source Training Courses and business 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
Java Resources
Well House Manor Resources
Perl Resources
Python Resources
PHP Resources
Object Orientation and General topics
MySQL Resources
Linux / LAMP / Tomcat Resources
Well House Consultants Resources
Extras Resources
C and C++ Resources
Ruby Resources
Tcl/Tk Resources
Web and Intranet Resources
Perl module P304
Exercises, examples and other material relating to training module P304. This topic is presented on public course Perl for Larger Projects

Perl variables can be given nonstandard characteristics, such as persistence so that they won't be lost when you exit from a program and then start it again. There are a number of exciting things you can do with this facility, known as tieing, but you also need to be careful that the code you write is easy to understand and maintain too.

Articles and tips on this subjectupdated
3409When variables behave differently - Tie in Perl
Deep in the bowels of any programming language is code to store information into a variable, and get information back from that variable. And in a language that's dynamic in its memory allocation, there will also be code to construct and destroy variables. Does that sound a bit "object oriented". ...
3007Setting up a matrix of data (2D array) for processing in your program
When you're reading and processing data, it often comes in the form of a series of records, with each record being split into a series of fields, and you'll often want to be going through the data several times, looking at different rows and colums, sorting them, comparing them, and so on. If the amount ...
2243Changing a variable behaviour in Perl - tieing
What can you do with a scalar variable? When you reduce it to lowest level programming principles, not a lot ... you can create it, destroy it, save a value into it, and read a value back from it. That's about it, when you think of it! In Perl, the low level memory accessors within the language ...
2379Making variables persistant, pretending a database is a variable and other Perl tricks
Have 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 seems to take an undefined variable, set it to one, and print it out. What a - err - pointless (!) ...
Examples from our training material
ac2   Using a tie class to force lower case
ac3   Using a tie class to force lower case
acm2   tieing a text file to a hash
acmagic   Persistant hash - NOT lost when the program exits
acnlook   Tieing a database file to a hash
acnset1   Crreating a database file through tie
acnset2   Tying a text file to a hash
ah   Tieing a variable to change its behaviour
alias_list   Accessing Unix's aliases database directly
allcodes   tied hash, unique key solution
aphash.pm   tie class definition - an appending hash
bowtie   Using a variable tied to a file
codes   location lookup
codes2   Place lookup without tie - variables are cas sensitive
flash.pm   Appending hash tie class definition
fyle.pm   links a variable to a file
game   Appliaction that uses a scalar as a stack
lower.pm   Tie class to force all strings to lower case
persist   Persistant variable via a tie class
pwl2   Looking up user accounts, case insensitive
pwlook   Looking up users, case sensitive
stack.pm   Tie class that hides a stack under a scalar
textfile.pm   tie class that treats a file as a scalar
thash.pm   Tie class to access a disc file as a hash, with caching
Trying out the subject taught in the last lecture
Background information
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
Tieing to scalars, hashes and lists.
Tieing to a scalar.
Tieing to a hash.
Tieing to make data more permanent.
Tieing a text file to a scalar.
Tieing a text file to a hash.
Tieing to database files.
Accessing system databases.
Tieing lists.
Tieing File Handles.
Complete learning
If you are looking for a complete course and not just a information on a single subject, visit our Listing and schedule page.

Well House Consultants specialise in training courses in Ruby, Lua, Python, Perl, PHP, and MySQL. We run Private Courses throughout the UK (and beyond for longer courses), and Public Courses 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.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2023: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/resources/P304.html • PAGE BUILT: Sun Oct 11 14:50:09 2020 • BUILD SYSTEM: JelliaJamb