summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Alders <olaf@wundersolutions.com>2021-01-12 23:09:21 -0500
committerOlaf Alders <olaf@wundersolutions.com>2021-01-13 09:40:02 -0500
commit4ae14b130afa39ca9d395d34b0a758f6d4af43cd (patch)
tree0ddd33697ddd16b01d152c349f3d8977db5dbd9b
parent091356cf1474689b0fad9363799f6a60621cdb96 (diff)
downloaduri-oalder/tidy-imports.tar.gz
Tidy import statementsoalder/tidy-imports
-rw-r--r--Changes1
-rw-r--r--lib/URI/WithBase.pm4
-rw-r--r--lib/URI/_idna.pm2
-rw-r--r--lib/URI/data.pm4
-rw-r--r--lib/URI/file/Base.pm2
-rw-r--r--lib/URI/ldapi.pm2
-rw-r--r--lib/URI/sip.pm2
-rw-r--r--t/abs.t2
-rw-r--r--t/clone.t2
-rw-r--r--t/data.t2
-rw-r--r--t/escape-char.t2
-rw-r--r--t/escape.t8
-rw-r--r--t/ftp.t2
-rw-r--r--t/generic.t2
-rw-r--r--t/gopher.t2
-rw-r--r--t/heuristic.t4
-rw-r--r--t/http.t2
-rw-r--r--t/iri.t4
-rw-r--r--t/ldap.t2
-rw-r--r--t/mailto.t2
-rw-r--r--t/mix.t4
-rw-r--r--t/mms.t2
-rw-r--r--t/news.t2
-rw-r--r--t/num_eq.t2
-rw-r--r--t/old-base.t2
-rw-r--r--t/old-relbase.t2
-rw-r--r--t/pop.t2
-rw-r--r--t/punycode.t2
-rw-r--r--t/query-param.t2
-rw-r--r--t/rel.t2
-rw-r--r--t/rfc2732.t2
-rw-r--r--t/roy-test.t4
-rw-r--r--t/rsync.t2
-rw-r--r--t/rtsp.t2
-rw-r--r--t/scheme-exceptions.t2
-rw-r--r--t/sip.t2
-rw-r--r--t/sort-hash-query-form.t2
-rw-r--r--t/split.t2
-rw-r--r--t/urn-isbn.t2
-rw-r--r--t/urn-oid.t2
-rw-r--r--t/utf8.t4
41 files changed, 48 insertions, 53 deletions
diff --git a/Changes b/Changes
index 8908bb7..266a44b 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
Revision history for URI
{{$NEXT}}
+ - Tidy import statements (GH#80) (Olaf Alders)
5.05 2020-10-21 13:00:44Z
- Bump all versions to 5.05 in order to remove various version mismatches.
diff --git a/lib/URI/WithBase.pm b/lib/URI/WithBase.pm
index 92321db..0f03ded 100644
--- a/lib/URI/WithBase.pm
+++ b/lib/URI/WithBase.pm
@@ -3,8 +3,8 @@ package URI::WithBase;
use strict;
use warnings;
-use URI;
-use Scalar::Util 'blessed';
+use URI ();
+use Scalar::Util qw(blessed);
our $VERSION = '5.06';
diff --git a/lib/URI/_idna.pm b/lib/URI/_idna.pm
index 0798d01..e4f734a 100644
--- a/lib/URI/_idna.pm
+++ b/lib/URI/_idna.pm
@@ -6,7 +6,7 @@ package URI::_idna;
use strict;
use warnings;
-use URI::_punycode qw(encode_punycode decode_punycode);
+use URI::_punycode qw(decode_punycode encode_punycode);
use Carp qw(croak);
our $VERSION = '5.06';
diff --git a/lib/URI/data.pm b/lib/URI/data.pm
index d0db011..a262fa6 100644
--- a/lib/URI/data.pm
+++ b/lib/URI/data.pm
@@ -7,8 +7,8 @@ use parent 'URI';
our $VERSION = '5.06';
-use MIME::Base64 qw(encode_base64 decode_base64);
-use URI::Escape qw(uri_unescape);
+use MIME::Base64 qw(decode_base64 encode_base64);
+use URI::Escape qw(uri_unescape);
sub media_type
{
diff --git a/lib/URI/file/Base.pm b/lib/URI/file/Base.pm
index 2b9ee49..23cfc82 100644
--- a/lib/URI/file/Base.pm
+++ b/lib/URI/file/Base.pm
@@ -3,7 +3,7 @@ package URI::file::Base;
use strict;
use warnings;
-use URI::Escape qw();
+use URI::Escape ();
our $VERSION = '5.06';
diff --git a/lib/URI/ldapi.pm b/lib/URI/ldapi.pm
index 42ec8c9..72d3756 100644
--- a/lib/URI/ldapi.pm
+++ b/lib/URI/ldapi.pm
@@ -7,7 +7,7 @@ our $VERSION = '5.06';
use parent qw(URI::_ldap URI::_generic);
-require URI::Escape;
+use URI::Escape ();
sub un_path {
my $self = shift;
diff --git a/lib/URI/sip.pm b/lib/URI/sip.pm
index 51f1045..85ca99d 100644
--- a/lib/URI/sip.pm
+++ b/lib/URI/sip.pm
@@ -12,7 +12,7 @@ use warnings;
use parent qw(URI::_server URI::_userpass);
-use URI::Escape qw(uri_unescape);
+use URI::Escape ();
our $VERSION = '5.06';
diff --git a/t/abs.t b/t/abs.t
index cf74ef4..fc5676e 100644
--- a/t/abs.t
+++ b/t/abs.t
@@ -6,7 +6,7 @@ print "1..45\n";
# This test the resolution of abs path for all examples given
# in the "Uniform Resource Identifiers (URI): Generic Syntax" document.
-use URI;
+use URI ();
my $base = "http://a/b/c/d;p?q";
my $testno = 1;
my @rel_fail;
diff --git a/t/clone.t b/t/clone.t
index 57201f5..6eb15eb 100644
--- a/t/clone.t
+++ b/t/clone.t
@@ -3,7 +3,7 @@ use warnings;
print "1..2\n";
-use URI::URL;
+use URI::URL ();
my $b = URI::URL->new("http://www/");
diff --git a/t/data.t b/t/data.t
index 31890ea..c67c8bf 100644
--- a/t/data.t
+++ b/t/data.t
@@ -3,7 +3,7 @@ use warnings;
print "1..22\n";
-use URI;
+use URI ();
my $u = URI->new("data:,A%20brief%20note");
print "not " unless $u->scheme eq "data" && $u->opaque eq ",A%20brief%20note";
diff --git a/t/escape-char.t b/t/escape-char.t
index b03e43d..c6ce79c 100644
--- a/t/escape-char.t
+++ b/t/escape-char.t
@@ -4,7 +4,7 @@ use warnings;
# see https://rt.cpan.org/Ticket/Display.html?id=96941
use Test::More;
-use URI;
+use URI ();
TODO: {
my $str = "http://foo/\xE9";
diff --git a/t/escape.t b/t/escape.t
index 05b8022..689277b 100644
--- a/t/escape.t
+++ b/t/escape.t
@@ -3,7 +3,7 @@ use warnings;
use Test::More tests => 12;
-use URI::Escape;
+use URI::Escape qw(%escapes uri_escape uri_escape_utf8 uri_unescape);
is uri_escape("|abcå"), "%7Cabc%E5";
@@ -19,14 +19,8 @@ is uri_unescape("%7Cabc%e5"), "|abcå";
is_deeply [uri_unescape("%40A%42", "CDE", "F%47H")], [qw(@AB CDE FGH)];
-
-use URI::Escape qw(%escapes);
-
is $escapes{"%"}, "%25";
-
-use URI::Escape qw(uri_escape_utf8);
-
is uri_escape_utf8("|abcå"), "%7Cabc%C3%A5";
skip "Perl 5.8.0 or higher required", 3 if $] < 5.008;
diff --git a/t/ftp.t b/t/ftp.t
index 9340885..c8a2c52 100644
--- a/t/ftp.t
+++ b/t/ftp.t
@@ -3,7 +3,7 @@ use warnings;
print "1..13\n";
-use URI;
+use URI ();
my $uri;
$uri = URI->new("ftp://ftp.example.com/path");
diff --git a/t/generic.t b/t/generic.t
index e2f7b97..4885ced 100644
--- a/t/generic.t
+++ b/t/generic.t
@@ -3,7 +3,7 @@ use warnings;
print "1..48\n";
-use URI;
+use URI ();
my $foo = URI->new("Foo:opaque#frag");
diff --git a/t/gopher.t b/t/gopher.t
index 427a5fc..8697eac 100644
--- a/t/gopher.t
+++ b/t/gopher.t
@@ -3,7 +3,7 @@ use warnings;
print "1..48\n";
-use URI;
+use URI ();
my $t = 1;
sub is {
diff --git a/t/heuristic.t b/t/heuristic.t
index 63c2ad8..e64c338 100644
--- a/t/heuristic.t
+++ b/t/heuristic.t
@@ -15,7 +15,7 @@ BEGIN {
print "1..26\n";
-use URI::Heuristic qw(uf_urlstr uf_url);
+use URI::Heuristic qw(uf_url uf_urlstr);
if (shift) {
$URI::Heuristic::DEBUG++;
open(STDERR, ">&STDOUT"); # redirect STDERR
@@ -59,7 +59,7 @@ print "ok 5\n";
print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(org|co)\.uk/camel\.gif$,;
print "ok 6\n";
- use Net::Domain;
+ use Net::Domain ();
$ENV{LC_ALL} = "C";
{ no warnings; *Net::Domain::hostfqdn = sub { return 'vasya.su' } }
undef $URI::Heuristic::MY_COUNTRY;
diff --git a/t/http.t b/t/http.t
index fb30124..1e00101 100644
--- a/t/http.t
+++ b/t/http.t
@@ -3,7 +3,7 @@ use warnings;
print "1..16\n";
-use URI;
+use URI ();
my $u = URI->new("<http://www.perl.com/path?q=fôo>");
diff --git a/t/iri.t b/t/iri.t
index f1dfd51..47600ab 100644
--- a/t/iri.t
+++ b/t/iri.t
@@ -3,7 +3,7 @@ use warnings;
use utf8;
use Test::More;
-use Config;
+use Config qw(%Config);
if (defined $Config{useperlio}) {
plan tests=>26;
@@ -11,7 +11,7 @@ if (defined $Config{useperlio}) {
plan skip_all=>'this perl doesn\'t support PerlIO layers';
}
-use URI;
+use URI ();
use URI::IRI;
my $u;
diff --git a/t/ldap.t b/t/ldap.t
index 3cd3dd8..3c45626 100644
--- a/t/ldap.t
+++ b/t/ldap.t
@@ -3,7 +3,7 @@ use warnings;
print "1..24\n";
-use URI;
+use URI ();
my $uri;
diff --git a/t/mailto.t b/t/mailto.t
index f13a1f8..d086e93 100644
--- a/t/mailto.t
+++ b/t/mailto.t
@@ -3,7 +3,7 @@ use warnings;
print "1..7\n";
-use URI;
+use URI ();
my $u = URI->new('mailto:gisle@aas.no');
diff --git a/t/mix.t b/t/mix.t
index b72942a..71772dd 100644
--- a/t/mix.t
+++ b/t/mix.t
@@ -4,9 +4,9 @@ use warnings;
print "1..6\n";
# Test mixing of URI and URI::WithBase objects
-use URI;
+use URI ();
use URI::WithBase;
-use URI::URL;
+use URI::URL ();
my $str = "http://www.sn.no/";
my $rel = "path/img.gif";
diff --git a/t/mms.t b/t/mms.t
index d3ac1d1..18d35a7 100644
--- a/t/mms.t
+++ b/t/mms.t
@@ -3,7 +3,7 @@ use warnings;
print "1..8\n";
-use URI;
+use URI ();
my $u = URI->new("<mms://66.250.188.13/KFOG_FM>");
diff --git a/t/news.t b/t/news.t
index a009a9e..947697f 100644
--- a/t/news.t
+++ b/t/news.t
@@ -3,7 +3,7 @@ use warnings;
print "1..7\n";
-use URI;
+use URI ();
my $u = URI->new("news:comp.lang.perl.misc");
diff --git a/t/num_eq.t b/t/num_eq.t
index 066d84c..257a5fa 100644
--- a/t/num_eq.t
+++ b/t/num_eq.t
@@ -5,7 +5,7 @@ use strict;
use warnings;
use Test::More 'no_plan';
-use URI;
+use URI ();
my $uri1 = URI->new("http://foo.com");
my $uri2 = URI->new("http://foo.com");
diff --git a/t/old-base.t b/t/old-base.t
index 984aab1..706051a 100644
--- a/t/old-base.t
+++ b/t/old-base.t
@@ -4,7 +4,7 @@ use warnings;
use Test::More 0.96;
use URI::URL qw(url);
use URI::Escape qw(uri_escape uri_unescape);
-use File::Temp 'tempdir';
+use File::Temp qw(tempdir);
# want compatibility
use URI::file;
diff --git a/t/old-relbase.t b/t/old-relbase.t
index 3bd0ae8..ae76a1d 100644
--- a/t/old-relbase.t
+++ b/t/old-relbase.t
@@ -3,7 +3,7 @@ use warnings;
print "1..5\n";
-use URI::URL;
+use URI::URL qw(url);
# We used to have problems with URLs that used a base that was
# not absolute itself.
diff --git a/t/pop.t b/t/pop.t
index 4519484..1c4709c 100644
--- a/t/pop.t
+++ b/t/pop.t
@@ -3,7 +3,7 @@ use warnings;
print "1..8\n";
-use URI;
+use URI ();
my $u = URI->new('pop://aas@pop.sn.no');
diff --git a/t/punycode.t b/t/punycode.t
index d1e3084..36d8e96 100644
--- a/t/punycode.t
+++ b/t/punycode.t
@@ -3,7 +3,7 @@ use warnings;
use utf8;
use Test::More tests => 15;
-use URI::_punycode qw(encode_punycode decode_punycode);
+use URI::_punycode qw(decode_punycode encode_punycode);
my %RFC_3492 = (
A => {
diff --git a/t/query-param.t b/t/query-param.t
index fc852c0..473b290 100644
--- a/t/query-param.t
+++ b/t/query-param.t
@@ -3,7 +3,7 @@ use warnings;
use Test::More tests => 19;
-use URI;
+use URI ();
use URI::QueryParam;
my $u = URI->new("http://www.sol.no?foo=4&bar=5&foo=5");
diff --git a/t/rel.t b/t/rel.t
index 104ae5d..32d66e6 100644
--- a/t/rel.t
+++ b/t/rel.t
@@ -5,7 +5,7 @@ use Test::More;
plan tests => 6;
-use URI;
+use URI ();
my $uri;
diff --git a/t/rfc2732.t b/t/rfc2732.t
index d69960a..2b0fa5b 100644
--- a/t/rfc2732.t
+++ b/t/rfc2732.t
@@ -5,7 +5,7 @@ use warnings;
use Test::More tests => 19;
-use URI;
+use URI ();
my $uri = URI->new("http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html");
is $uri->as_string, "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html";
diff --git a/t/roy-test.t b/t/roy-test.t
index a7a9fdc..db06c26 100644
--- a/t/roy-test.t
+++ b/t/roy-test.t
@@ -1,10 +1,10 @@
use strict;
use warnings;
-use Test qw(plan ok);
+use Test qw(ok plan);
plan tests => 102;
-use URI;
+use URI ();
use File::Spec::Functions qw(catfile);
my $no = 1;
diff --git a/t/rsync.t b/t/rsync.t
index 01e91d7..5a65aae 100644
--- a/t/rsync.t
+++ b/t/rsync.t
@@ -3,7 +3,7 @@ use warnings;
print "1..4\n";
-use URI;
+use URI ();
my $u = URI->new('rsync://gisle@perl.com/foo/bar');
diff --git a/t/rtsp.t b/t/rtsp.t
index 208b63b..af08064 100644
--- a/t/rtsp.t
+++ b/t/rtsp.t
@@ -3,7 +3,7 @@ use warnings;
print "1..9\n";
-use URI;
+use URI ();
my $u = URI->new("<rtsp://media.perl.com/fôo.smi/>");
diff --git a/t/scheme-exceptions.t b/t/scheme-exceptions.t
index 82740be..e1cb568 100644
--- a/t/scheme-exceptions.t
+++ b/t/scheme-exceptions.t
@@ -2,7 +2,7 @@ use strict;
use warnings;
use Test::More;
-use URI;
+use URI ();
plan skip_all => 'this test assumes that URI::javascript does not exist'
if eval { +require URI::javascript };
diff --git a/t/sip.t b/t/sip.t
index 506bba3..4a069ff 100644
--- a/t/sip.t
+++ b/t/sip.t
@@ -3,7 +3,7 @@ use warnings;
print "1..11\n";
-use URI;
+use URI ();
my $u = URI->new('sip:phone@domain.ext');
print "not " unless $u->user eq 'phone' &&
diff --git a/t/sort-hash-query-form.t b/t/sort-hash-query-form.t
index 7c6f896..b79a4b7 100644
--- a/t/sort-hash-query-form.t
+++ b/t/sort-hash-query-form.t
@@ -5,7 +5,7 @@ use Test::More;
# ABSTRACT: Make sure query_form(\%hash) is sorted
-use URI;
+use URI ();
my $base = URI->new('http://example.org/');
diff --git a/t/split.t b/t/split.t
index 34104b8..58c3c5f 100644
--- a/t/split.t
+++ b/t/split.t
@@ -3,7 +3,7 @@ use warnings;
print "1..17\n";
-use URI::Split qw(uri_split uri_join);
+use URI::Split qw(uri_join uri_split);
sub j { join("-", map { defined($_) ? $_ : "<undef>" } @_) }
diff --git a/t/urn-isbn.t b/t/urn-isbn.t
index f512bde..18136ef 100644
--- a/t/urn-isbn.t
+++ b/t/urn-isbn.t
@@ -5,7 +5,7 @@ use Test::Needs 'Business::ISBN';
print "1..13\n";
-use URI;
+use URI ();
my $u = URI->new("URN:ISBN:0395363411");
print "not " unless $u eq "URN:ISBN:0395363411" &&
diff --git a/t/urn-oid.t b/t/urn-oid.t
index d35e524..8298749 100644
--- a/t/urn-oid.t
+++ b/t/urn-oid.t
@@ -3,7 +3,7 @@ use warnings;
print "1..4\n";
-use URI;
+use URI ();
my $u = URI->new("urn:oid");
diff --git a/t/utf8.t b/t/utf8.t
index 1453cfc..1e26864 100644
--- a/t/utf8.t
+++ b/t/utf8.t
@@ -4,7 +4,7 @@ use warnings;
use utf8;
use Test::More 'no_plan';
-use URI;
+use URI ();
is(URI->new('http://foobar/mooi€e')->as_string, 'http://foobar/mooi%E2%82%ACe');
@@ -14,7 +14,7 @@ is( $uri->query, "mooi%E2%82%ACe=mooi%E2%82%ACe" );
is( ($uri->query_form)[1], "mooi\xE2\x82\xACe" );
# RT#70161
-use Encode;
+use Encode qw(decode_utf8);
$uri = URI->new(decode_utf8 '?Query=%C3%A4%C3%B6%C3%BC');
is( ($uri->query_form)[1], "\xC3\xA4\xC3\xB6\xC3\xBC");
is( decode_utf8(($uri->query_form)[1]), 'äöü');