Subject: | [PATCH] Protocol/file.pm: postpone load of URI::Escape and HTML::Entities |
Date: | Thu, 6 Mar 2008 08:58:27 +0300 |
To: | bug-libwww-perl [...] rt.cpan.org |
From: | Alexey Tourbin <at [...] altlinux.ru> |
I noticed that, when running XML::Parser test suite (external_ent.t),
suddenly HTML::Parser gets loaded along with LWP stuff. Since
the code that uses HTML::* thing is conditional (directory listing),
it is good idea to postpone the load of extra modules.
After this change, XML::Parser test suite does not need HTML::Parser
any longer.
---
lib/LWP/Protocol/file.pm | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/LWP/Protocol/file.pm b/lib/LWP/Protocol/file.pm
index 5261cca..137a2a1 100644
--- a/lib/LWP/Protocol/file.pm
+++ b/lib/LWP/Protocol/file.pm
@@ -14,10 +14,6 @@ require HTTP::Response;
require HTTP::Status;
require HTTP::Date;
-require URI::Escape;
-require HTML::Entities;
-
-
sub request
{
@@ -96,6 +92,8 @@ sub request
closedir(D);
# Make directory listing
+ require URI::Escape;
+ require HTML::Entities;
my $pathe = $path . ( $^O eq 'MacOS' ? ':' : '/');
for (@files) {
my $furl = URI::Escape::uri_escape($_);
--
1.5.3.8.GIT