-dbmopen(%db,$dbname,0444) or die "error: cannot open db.\n";
-foreach (keys %db) {
- next if /=>/; # skip the key if it contains the delimiter.
-
- print "$_ => $db{$_}\n";
+dbmopen( %db, $dbfile, 0644 ) or die "error: cannot open db. $dbfile\n";
+my ( $key, $val );
+while ( ( $key, $val ) = each %db ) {
+ chomp $val;
+ print "$key => $val\n";