summarylogtreecommitdiffstats
path: root/uri2file
diff options
context:
space:
mode:
authorRoman Savelyev2015-10-02 01:08:05 +0300
committerRoman Saveljev2015-10-02 01:42:40 +0300
commit2eb40f1fe61955c17b82cb17fd2a792d30fcb8f8 (patch)
treecc8c9ae7037f7abc9c217b53e011288ea38e883e /uri2file
downloadaur-file-uri-tools.tar.gz
Initial commit
Diffstat (limited to 'uri2file')
-rwxr-xr-xuri2file31
1 files changed, 31 insertions, 0 deletions
diff --git a/uri2file b/uri2file
new file mode 100755
index 00000000000..12c9c3d1b0b
--- /dev/null
+++ b/uri2file
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+
+# The MIT License (MIT)
+#
+# Copyright (c) 2015 Roman Savelyev
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+use feature 'say';
+use strict;
+use URI;
+
+my $u = URI->new($ARGV[0]) || die $!;
+say $u->path;
+