Book HomeJava and XSLTSearch this book

8.221. Tie::Scalar

The basic Tie::Scalar package provides a new method, as well as methods TIESCALAR, FETCH, and STORE. The new method is provided as backup in case a class has no TIESCALAR method.

To write your own tied hashes, the methods listed here are required. See the perltie manpage for more detailed information and for examples.

TIESCALAR

TIESCALAR classname, list

Constructor. Associates new scalar instance with class classname. listrepresents any additional arguments needed to complete the association.

tie $scalar, classname, list
DESTROY

DESTROY this

Frees storage associated with the tied scalar referenced by this. Permits a class to perform specific actions when an instance is destroyed. Rarely needed.

FETCH

FETCH this

Retrieves value of the tied scalar referenced by this.

STORE

STORE this, value

Stores value in the tied scalar referenced by this.



Library Navigation Links

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