Tie::Restore - restores ties to an existing object


Tie-Restore documentation Contained in the Tie-Restore distribution.

Index


Code Index:

NAME

Top

Tie::Restore - restores ties to an existing object

DESCRIPTION

Top

Provides the opposite of the 'tied' function. Say you have %hash that is tied to $object. Then, it is relatively simple to get $object from %hash simply by saying

 $object = tied %hash;

But, how does one go the other way? Simple, with Tie::Restore

 tie %hash, 'Tie::Restore', $object;

Works for any kind of tie. (scalar, array, hash, filehandle)

HISTORY

Top

BUGS

Top

None known. Hard to imagine anything serious in 6 lines of code...

AUTHORS AND COPYRIGHT

Top


Tie-Restore documentation Contained in the Tie-Restore distribution.

#!/usr/local/bin/perl

#----------------------------------------------------------

package Tie::Restore;

our $VERSION = 0.11;

sub TIESCALAR { $_[1] }
sub TIEARRAY  { $_[1] }
sub TIEHASH   { $_[1] }
sub TIEHANDLE { $_[1] }

1;

__END__