From 24463849d4236a0a7c848c0cf657e927514d75d4 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Tue, 26 Jun 2001 16:12:32 +0000 Subject: [PATCH] added useful tools for perl debugging: - 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 | 19 +++++++++++++++++++ helm/http_getter/tools/uri_escape.pl | 16 ++++++++++++++++ helm/http_getter/tools/uri_unescape.pl | 15 +++++++++++++++ 3 files changed, 50 insertions(+) create mode 100755 helm/http_getter/tools/dump_db.pl create mode 100755 helm/http_getter/tools/uri_escape.pl create mode 100755 helm/http_getter/tools/uri_unescape.pl diff --git a/helm/http_getter/tools/dump_db.pl b/helm/http_getter/tools/dump_db.pl new file mode 100755 index 000000000..95d3f4ab5 --- /dev/null +++ b/helm/http_getter/tools/dump_db.pl @@ -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 +# = +# +# Stefano "Zack" Zacchiroli +# + +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 index 000000000..0303e3f73 --- /dev/null +++ b/helm/http_getter/tools/uri_escape.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl -w +use strict; + +# escape a URI with uri escaping +# +# Stefano "Zack" Zacchiroli +# + + +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 index 000000000..7f77d3768 --- /dev/null +++ b/helm/http_getter/tools/uri_unescape.pl @@ -0,0 +1,15 @@ +#!/usr/bin/perl -w +use strict; + +# unescape a URI escaped with uri escaping +# +# Stefano "Zack" Zacchiroli +# + +use URI::Escape; + +while(<>) { + chomp; + print uri_unescape($_); + print "\n"; +} -- 2.39.2