- tools/dump_db.pl => print out a dump of a .db file
- tools/uri_escape.pl => escape a URI
- tools/uri_unescape.pl => unescape a URI
very little things, but really useful!
--- /dev/null
+#!/usr/bin/perl -w
+
+# dump on stdout the data contained in a db file.
+# Print one line for each record in this format
+# <key> = <value>
+#
+# Stefano "Zack" Zacchiroli <zack@cs.unibo.it>
+#
+
+use strict qw(O_RDONLY);
+use DB_File;
+
+my $dbfile = shift || die "which db file ?";
+my %map;
+tie(%map, 'DB_File', $dbfile, O_RDONLY, 0664);
+while(($key,$value) = each %map) {
+ print "$key = $value\n";
+}
+
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+
+# escape a URI with uri escaping
+#
+# Stefano "Zack" Zacchiroli <zack@cs.unibo.it>
+#
+
+
+use URI::Escape;
+
+while(<>) {
+ chomp;
+ print uri_escape($_);
+ print "\n";
+}
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+
+# unescape a URI escaped with uri escaping
+#
+# Stefano "Zack" Zacchiroli <zack@cs.unibo.it>
+#
+
+use URI::Escape;
+
+while(<>) {
+ chomp;
+ print uri_unescape($_);
+ print "\n";
+}