home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / Tie::RefHash.z / Tie::RefHash
Encoding:
Text File  |  1998-10-30  |  1.7 KB  |  67 lines

  1.  
  2.  
  3.  
  4. TTTTiiiieeee::::::::RRRReeeeffffHHHHaaaasssshhhh((((3333))))                                                TTTTiiiieeee::::::::RRRReeeeffffHHHHaaaasssshhhh((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tie::RefHash - use references as hash keys
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.          require 5.004;
  13.          use Tie::RefHash;
  14.          tie HASHVARIABLE, 'Tie::RefHash', LIST;
  15.  
  16.          untie HASHVARIABLE;
  17.  
  18.  
  19. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  20.      This module provides the ability to use references as hash keys if you
  21.      first tie the hash variable to this module.
  22.  
  23.      It is implemented using the standard perl TIEHASH interface.  Please see
  24.      the tie entry in _p_e_r_l_f_u_n_c(1) and _p_e_r_l_t_i_e(1) for more information.
  25.  
  26. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  27.          use Tie::RefHash;
  28.          tie %h, 'Tie::RefHash';
  29.          $a = [];
  30.          $b = {};
  31.          $c = \*main;
  32.          $d = \"gunk";
  33.          $e = sub { 'foo' };
  34.          %h = ($a => 1, $b => 2, $c => 3, $d => 4, $e => 5);
  35.          $a->[0] = 'foo';
  36.          $b->{foo} = 'bar';
  37.          for (keys %h) {
  38.             print ref($_), "\n";
  39.          }
  40.  
  41.  
  42. AAAAUUUUTTTTHHHHOOOORRRR
  43.      Gurusamy Sarathy        gsar@umich.edu
  44.  
  45. VVVVEEEERRRRSSSSIIIIOOOONNNN
  46.      Version 1.2    15 Dec 1996
  47.  
  48. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  49.      _p_e_r_l(1), _p_e_r_l_f_u_n_c(1), _p_e_r_l_t_i_e(1)
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.