Book HomeLearning Perl, 3rd EditionSearch this book

B.21. Tied Variables

Do you remember how the DBM hash (in Chapter 16, "Simple Databases") is "magically" connected to a file, so that accesses to the hash are really working with the corresponding DBM file? You can actually make any variable magical in that way. A tied variable may be accessed like any other, but using your own code behind the scenes. So you could make a scalar that is really stored on a remote machine, or an array that always stays sorted. See the perltie manpage.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.