validator/httpd/cgi-bin check,1.546,1.547

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv25446/httpd/cgi-bin

Modified Files:
	check 
Log Message:
Use top-level "use" for pulling in non-optional modules (XML::LibXML,
HTTP::Negotiate) instead of on-demand "require" so they need to be compiled
only once with mod_perl.  While at it, sort list of imported modules (except
HTTP::Headers::Auth which still needs to be imported after other HTTP::*).


Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.546
retrieving revision 1.547
diff -u -d -r1.546 -r1.547
--- check	25 Jul 2007 04:37:36 -0000	1.546
+++ check	25 Jul 2007 17:37:25 -0000	1.547
@@ -46,19 +46,22 @@
 use CGI                  2.81 qw(-newstyle_urls -private_tempfiles redirect);
 use CGI::Carp                 qw(carp croak fatalsToBrowser);
 use Config::General      2.19 qw(); # Need 2.19 for -AutoLaunder
+use Encode                    qw();
+use Encode::Alias             qw();
+use Encode::HanExtra          qw(); # for some chinese character encodings,
+                                    # e.g gb18030
+use Encode::JIS2K             qw(); # ditto extra japanese encodings
 use File::Spec                qw();
+use HTML::Encoding       0.52 qw();
 use HTML::Parser         3.25 qw(); # Need 3.25 for $p->ignore_elements.
 use HTML::Template       2.6  qw();
+use HTTP::Negotiate           qw();
 use HTTP::Request             qw();
 use HTTP::Headers::Auth       qw(); # Needs to be imported after other HTTP::*.
+use SGML::Parser::OpenSP      qw();
 use URI                       qw();
 use URI::Escape               qw(uri_escape);
-use Encode                    qw();
-use Encode::Alias             qw();
-use Encode::HanExtra          qw(); #for some chinese character encodings, e.g gb18030
-use Encode::JIS2K             qw(); # ditto extra japanese encodings
-use HTML::Encoding       0.52 qw();
-use SGML::Parser::OpenSP      qw();
+use XML::LibXML               qw();
 
 ###############################################################################
 #### Constant definitions. ####################################################
@@ -293,7 +296,6 @@
     push @localizations, [$lang_available, 1.000, 'text/html', undef,
                           'utf-8', $lang_available, undef];
   }
-  require HTTP::Negotiate;
   $lang = HTTP::Negotiate::choose(\@localizations);
 }
 
@@ -628,7 +630,6 @@
 # but it's badly linked to opensp at the moment
 if (&is_xml($File)) {
 
-  require XML::LibXML;
   my $xmlparser = XML::LibXML->new();
   $xmlparser->line_numbers(1);
   # loading the XML catalog for entities resolution

Received on Wednesday, 25 July 2007 17:37:31 UTC