summaryrefslogtreecommitdiff
path: root/lib/Tools.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Tools.pm')
-rw-r--r--lib/Tools.pm15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Tools.pm b/lib/Tools.pm
index b8d65f0..155de0a 100644
--- a/lib/Tools.pm
+++ b/lib/Tools.pm
@@ -21,9 +21,10 @@ our $BENCH = {};
our $LOGCALLB = sub{ };
our $DBH = {};
-@EXPORT = qw(&datum &stackTrace &lg &event &debug &error &panic &rep2str &dumper &getFromSocket &fields
- &load_file &save_file &tableUpdated &buildsearch &deleteDir &getip &convert &int &entities &reentities &bench
- &fmttime &getDataByTable &getDataById &getDataBySearch &getDataByFields &touch);
+@EXPORT = qw(&datum &stackTrace &lg &event &debug &error &panic &rep2str &dumper
+ &getFromSocket &fields &load_file &save_file &tableUpdated &buildsearch
+ &deleteDir &getip &convert &int &entities &reentities &bench &fmttime
+ &getDataByTable &getDataById &getDataBySearch &getDataByFields &touch &url);
# ------------------
@@ -607,4 +608,12 @@ sub touch {
|| error sprintf("Couldn't touch '%s' : %s",$file,$!);
}
+# ------------------
+sub url{
+# ------------------
+ my $s = shift; # string
+ $s =~ s/([^a-z0-9A-Z])/sprintf('%%%X', ord($1))/seg;
+ return $s;
+}
+
1;