package Tie::Static; $VERSION = 0.01; foreach my $type (qw(Hash Array Scalar)) { my $meth = uc($type); eval qq( package Tie::Static::$type; require Tie::$type; \@ISA = 'Tie::Std$type'; sub Tie::Static::TIE$meth { my \$id = join "|", caller(), \@_; return \$preserved{\$id} ||= Tie::Static::$type->TIE$meth; } ) or die $@; } 1;