Basic HTML version of Foils prepared Sept 20 97

Foil 55 tie() and untie() Perl Functions - I

From Perl5 and Advanced Perl4 Features Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


tie() and untie() are described in PerlTIE Man Page
These generate "enchanted" variables ( magical blessing!) which allows one to access what seems to be an ordinary variables in a Perl Program but behind the scenes, the implementation of variable dioes a lot of work which could include computation, data access etc.
Examples in PerlTIE include:
tie a scalar $priority which returns process or user priority by accessing UNIX system
tie a hash to a database so that
$tiedhash{lookupkey} returns value of lookupkey in database
This latter tie is most powerful and could involve SQL access to the database sever when tied hash accessed



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Apr 5 1998