load#

Read a dump file - ASCII or binary, from dump here or from gdbm’s own tools - into the database.

Synopsis#

my $db = tie my %h, 'GDBM_File', 'a.gdbm', GDBM_NEWDB, 0640 or die;
$db->load('a.dump');
$db->load('more.dump', replace => 1);

Options#

  • replace => 1 - a key already in the database takes the dump’s value; without it such a key croaks.

  • restore_mode => 0, restore_owner => 0 - do not give the database file the mode, or the owner, an ASCII dump records. By default both are restored, and failing to restore them is not an error.

  • strict_errors => 1 - croak when the mode or owner cannot be restored.

What you get back#

Nothing; a failure croaks FILE:LINE: database load error: MESSAGE (or without the line). An unknown option croaks unrecognized keyword: NAME.

Differences from upstream#

A dump holding an empty key or an empty value loads; gdbm 1.26 writes such dumps but cannot load them. Covered by t/82-native/Peta-LMDB/090-gdbm.t.

See also#

  • dump - writes a dump