```{index} single: dump (GDBM_File) ``` ```{index} single: GDBM_File::dump ``` # dump Write the database's keys and values to a dump file in gdbm's format, which `load` - here or in perl 5 with gdbm - reads back. ## Synopsis ```perl $db->dump('data.dump'); $db->dump('data.bin', binary => 1, mode => 0600, overwrite => 1); ``` ## Options - `binary => 1` - gdbm's old binary format instead of its ASCII one. The ASCII dump also records the file's name, owner and mode. - `mode => $mode` - the dump file's permissions (default `0666`, less the umask). - `overwrite => 1` - replace an existing dump file; without it, an existing file croaks. ## What you get back Nothing; a failure croaks with gdbm's message. An unknown option croaks `unrecognized keyword: NAME`. ## Examples Move a real gdbm database to pperl: dump it under perl 5 with gdbm, then load it here. ```perl # perl 5: (tied %old)->dump('move.dump'); my $db = tie my %h, 'GDBM_File', 'new.gdbm', GDBM_NEWDB, 0640 or die; $db->load('move.dump'); ``` ## Differences from upstream Fully compatible with upstream: gdbm loads pperl's dumps and pperl gdbm's. Covered by `t/81-xs-native/GDBM_File/010-phenotype.t`. ## See also - `load` - reads a dump back