From babe54bf97091441353f2219e7846afd0e0d9f16 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 27 Aug 2012 11:11:30 -0400 Subject: [PATCH] Add missing file --- perl/lib/Nix/Utils.pm | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 perl/lib/Nix/Utils.pm diff --git a/perl/lib/Nix/Utils.pm b/perl/lib/Nix/Utils.pm new file mode 100644 index 000000000..943b8dd4a --- /dev/null +++ b/perl/lib/Nix/Utils.pm @@ -0,0 +1,8 @@ +package Nix::Utils; + +$urlRE = "(?: [a-zA-Z][a-zA-Z0-9\+\-\.]*\:[a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*]+ )"; + +sub checkURL { + my ($url) = @_; + die "invalid URL ‘$url’\n" unless $url =~ /^ $urlRE $ /x; +}