use strict; use warnings; use DB_File; tie my %foo, "DB_File", undef, undef, undef, $DB_BTREE; %foo = (1 => 'value1',2 => 'value2',3 => 'value3'); while(my($k, $v) = each %foo) { print "$k -> $v\n"; }