2 # Tie/RefHash.pm - use references as hash keys
4 # Documentation at the __END__
18 $s->STORE(shift, shift);
25 (ref $k) ? $s->[0]{"$k"}[1] : $s->[1]{$k};
31 $s->[0]{"$k"} = [$k, $v];
41 (ref $k) ? delete($s->[0]{"$k"}) : delete($s->[1]{$k});
46 (ref $k) ? exists($s->[0]{"$k"}) : exists($s->[1]{$k});
51 my $a = scalar(keys %{$s->[0]}) + scalar(keys %{$s->[1]});
60 if (($k, $v) = each %{$s->[0]}) {
61 return $s->[0]{"$k"}[0];
67 return each %{$s->[1]};
83 Tie::RefHash - use references as hash keys
90 tie HASHVARIABLE, 'Tie::RefHash', LIST;
97 This module provides the ability to use references as hash keys if
98 you first C<tie> the hash variable to this module.
100 It is implemented using the standard perl TIEHASH interface. Please
101 see the C<tie> entry in perlfunc(1) and perltie(1) for more information.
107 tie %h, 'Tie::RefHash';
113 %h = ($a => 1, $b => 2, $c => 3, $d => 4, $e => 5);
123 Gurusamy Sarathy gsar@umich.edu
128 Version 1.2 15 Dec 1996
133 perl(1), perlfunc(1), perltie(1)