httpd-users mailing list archives

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

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;
close(TXT);

Bye and thanks,
Werner


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message