2 use SDBM_File; 3 use MLDBM qw (SDBM_File); 4 use Fcntl; 5 6 #tie (%h, 'MLDBM', 'dbm_file', O_CREAT|O_RDWR, 0666) || die "couldnt open tie-file\n"; 7 8 $h{ "1" } = { "a" => "first" }; 9 $h{ "2" } = { "a" => "second" }; 10 $h{ "3" } = { "a" => "third" }; 11 12 foreach ( keys %h ) 13 { 14 $value = ${ $h{ $_ } }{ "a" }; 15 print "key: .$_. value: .$value.\n"; 16 }; 17 18 if ( exists $h{ "1" } ) 19 { 20 $h{ "1" } = [ "a", "b", "c" ]; 21 22 foreach ( @{ $h{ "1" } } ) 23 { 24 print "value is: .$_.\n"; 25 }; 26 }; #### key: .1. value: .first. key: .2. value: .second. key: .3. value: .third. value is: .a. value is: .b. value is: .c. #### key: .1. value: .first. key: .2. value: .second. key: .3. value: .third. SDBM_File doesn't define an EXISTS method at dbm.pl line 18