Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!ccu.umanitoba.ca!rahardj From: rahardj@ccu.umanitoba.ca (B. Rahardjo) Newsgroups: comp.lang.perl Subject: problem reading assoc array (pl. 28) Keywords: dbm assoc Message-ID: <1990Sep14.014322.8439@ccu.umanitoba.ca> Date: 14 Sep 90 01:43:22 GMT Sender: rahardj@ccu.umanitoba.ca Followup-To: comp.lang.perl Organization: University of Manitoba, Winnipeg, Canada Lines: 27 After upgrade my perl into pl. 28 I have been having some problems with reading associative array. The following script doesn't produce the output that I want. Help .... -- budi ----- cut here ----- #!/usr/local/bin/perl # $filename='testfile'; # Create a dbm file dbmopen(RECORD,$filename,0666); $RECORD{'one'}='One and only one'; $RECORD{'two'}='Number two'; dbmclose(RECORD); # Read the dbm file back dbmopen(recd,$filename,0666); print 'The keys are : ', keys %recd, "\n"; print 'The values are : ', values %recd, "\n"; foreach $i (keys %recd) { print "$i : $recd{$i}\n"; # THIS PART DOESN'T WORK } dbmclose(recd); -- Budi Rahardjo Electrical Engineering - University of Manitoba - Canada