X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7b28deb171455a207e536b8abebbca67242a4588..d379d8ab9dc999da6dcd3212634e9d2dc97d7a3e:/plugins/externaldemo?ds=inline diff --git a/plugins/externaldemo b/plugins/externaldemo index be7aba8b9..24861dcc9 100755 --- a/plugins/externaldemo +++ b/plugins/externaldemo @@ -8,7 +8,6 @@ use strict; print STDERR "externaldemo plugin running as pid $$\n"; use RPC::XML; -use RPC::XML::Parser; use IO::Handle; # autoflush stdout @@ -31,7 +30,19 @@ sub rpc_read { $accum=$2; # the rest # Now parse the XML RPC. - my $r = RPC::XML::Parser->new->parse($1); + my $parser; + eval q{ + use RPC::XML::ParserFactory; + $parser = RPC::XML::ParserFactory->new; + }; + if ($@) { + # old interface + eval q{ + use RPC::XML::Parser; + $parser = RPC::XML::Parser->new; + }; + } + my $r=$parser->parse($1); if (! ref $r) { die "error: XML RPC parse failure $r"; }