httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Werner Schalk" <>
Subject txt2dbm script
Date Thu, 01 Aug 2002 14:31:34 GMT

I have just copied the txt2dbm
perl script which can be found
on page 458 of the apache pdf handbook.
Now I tried to convert an existing
txt file to dbm format and did a
"txt2dbm file.txt file.dbm" but he
creates some two binary files which
have completly strange file names:
- file.dbm.dir
- file.dbm.pag

Is this correct? Does it really create
two files? Which one must I use for a
RewriteRule command? The txt2dbm perl file
looks like this:

use NDBM_File;
use Fcntl;
($txtmap, $dbmmap) = @ARGV;
open(TXT, "<$txtmap") or die "Couldn't open $txtmap!\n";
tie (%DB, 'NDBM_File', $dbmmap,O_RDWR|O_TRUNC|O_CREAT, 0644) or die
"Couldn't create $dbmmap!\n";
while (<TXT>) {
next if (/^\s*#/ or /^\s*$/);
$DB{$1} = $2 if (/^\s*(\S+)\s+(\S+)/);
untie %DB;

Bye and thanks,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message