home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Perl CookbookPerl CookbookSearch this book

14.3. Converting Between DBM Files

14.3.3. Discussion

When multiple types of DBM file are used in the same program, you have to use tie, not the dbmopen interface. That's because with dbmopen you can use only one database format, which is why its use is deprecated.

Copying hashes by simple assignment, as in %new = %old, works on DBM files. However, it loads everything into memory first as a list, which doesn't matter with small hashes, but can be prohibitively expensive in the case of DBM files. For database hashes, use each to iterate through them instead.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.