From: short <> Date: Tue, 19 Oct 2004 14:51:51 +0000 (+0000) Subject: 'Geo::IP' dependency is now optional. X-Git-Url: http://git.jankratochvil.net/?p=MyWeb.git;a=commitdiff_plain;h=4765a27e0117f3eb89852f4095023c039705efdf 'Geo::IP' dependency is now optional. --- diff --git a/Web.pm b/Web.pm index ea6f32f..2c720f3 100644 --- a/Web.pm +++ b/Web.pm @@ -69,8 +69,9 @@ use Carp qw(cluck confess); use URI::Escape; require HTTP::BrowserDetect; require HTTP::Negotiate; -require Geo::IP; +my $have_Geo_IP; BEGIN { $have_Geo_IP=eval { require Geo::IP; 1; }; } require CGI; +require Apache2; # Undo 'www/engine/httpd-restart' as it may use obsolete Perl for 'mod_perl' @@ -436,6 +437,7 @@ sub remote_ip () sub is_cz () { + return 0 if !$have_Geo_IP; return "CZ" eq Geo::IP->new()->country_code_by_addr(remote_ip()); }