THRIFT-850. Use AX_PROG_PERL_MODULES to test for Bit::Vector

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@991249 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/configure.ac b/configure.ac
index fb42759..838aa94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,11 +153,11 @@
 AX_THRIFT_LIB(perl, [Perl], yes)
 if test "$with_perl" = "yes"; then
   AC_PATH_PROG([PERL], [perl])
-  if test -n "`$PERL -MBit::Vector -e exit 2>&1`"; then
-    AC_MSG_WARN([Perl Bit::Vector module not installed, skipping perl])
-    have_perl_bit_vector="no"
+  if test -n "$PERL" ; then
+    AC_PROG_PERL_MODULES([Bit::Vector], success="yes", success="no")
+    have_perl_bit_vector="$success"
   fi
-  if test -n "$PERL" -a -z "$have_perl_bit_vector" ; then
+  if test -n "$PERL" -a "$have_perl_bit_vector" = "yes" ; then
     have_perl="yes"
   fi
 fi