Modified:
trunk/perl/perl-test.cgi
Log:
run without LWPx::ParanoidAgent; just warn if without
Modified: trunk/perl/perl-test.cgi
==============================================================================
--- trunk/perl/perl-test.cgi (original)
+++ trunk/perl/perl-test.cgi Fri Oct 17 15:30:14 2008
@@ -9,7 +9,14 @@
use warnings;
use Net::OpenID::Server;
use Net::OpenID::Consumer;
-use LWPx::ParanoidAgent;
+
+my $HAVE_PARANOID_AGENT = 0;
+BEGIN {
+ $HAVE_PARANOID_AGENT = eval "use LWPx::ParanoidAgent; 1;";
+ unless ($HAVE_PARANOID_AGENT) {
+ warn "WARNING: running without LWPx::ParanoidAgent; not installed?\n";
+ }
+}
my $q = CGI->new;
my $path_info = $ENV{PATH_INFO} || "";
@@ -216,7 +223,7 @@
my $base = $self->base;
my $csr = Net::OpenID::Consumer->new
(
- ua => LWPx::ParanoidAgent->new,
+ ua => $HAVE_PARANOID_AGENT ? LWPx::ParanoidAgent->new : undef,
cache => $self->{rpcache},
args => $cgi,
consumer_secret => $self->consumer_secret,
@@ -325,7 +332,7 @@
my $base = $self->base;
my $csr = Net::OpenID::Consumer->new
(
- ua => LWPx::ParanoidAgent->new,
+ ua => $HAVE_PARANOID_AGENT ? LWPx::ParanoidAgent->new : undef,
cache => $cache,
args => $cgi,
consumer_secret => $self->consumer_secret,