]> matita.cs.unibo.it Git - helm.git/commitdiff
added useful tools for perl debugging:
authorStefano Zacchiroli <zack@upsilon.cc>
Tue, 26 Jun 2001 16:12:32 +0000 (16:12 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Tue, 26 Jun 2001 16:12:32 +0000 (16:12 +0000)
- 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!

helm/http_getter/tools/dump_db.pl [new file with mode: 0755]
helm/http_getter/tools/uri_escape.pl [new file with mode: 0755]
helm/http_getter/tools/uri_unescape.pl [new file with mode: 0755]

diff --git a/helm/http_getter/tools/dump_db.pl b/helm/http_getter/tools/dump_db.pl
new file mode 100755 (executable)
index 0000000..95d3f4a
--- /dev/null
@@ -0,0 +1,19 @@
+#!/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";
+}
+
diff --git a/helm/http_getter/tools/uri_escape.pl b/helm/http_getter/tools/uri_escape.pl
new file mode 100755 (executable)
index 0000000..0303e3f
--- /dev/null
@@ -0,0 +1,16 @@
+#!/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";
+}
diff --git a/helm/http_getter/tools/uri_unescape.pl b/helm/http_getter/tools/uri_unescape.pl
new file mode 100755 (executable)
index 0000000..7f77d37
--- /dev/null
@@ -0,0 +1,15 @@
+#!/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";
+}