in reply to DB_File
#!/usr/bin/perl -w use strict; use DB_File; use Fcntl; unlink 'data.db'; tie my %hash, 'DB_File', 'data.db', O_RDWR|O_CREAT; foreach my $size (100, 200, 500, 900, 1000) { my $k = 'k' x $size; my $v = 'v' x $size; $hash{ $k } = $v; } untie %hash;
#!/usr/bin/perl -w use strict; use DB_File; use Fcntl; print "using version: $DB_File::VERSION\n"; tie my %hash, 'DB_File', 'data.db'; foreach my $k (sort keys %hash) { printf "%d => %d\n", length($k), length($hash{$k}); }
|
|---|