From 72fff1910feb13a0b1fb59d0480056b4d78d6b50 Mon Sep 17 00:00:00 2001 From: David Golden Date: Tue, 15 Apr 2014 13:46:32 -0400 Subject: [PATCH] Explicitly load re::regexp_pattern for 5.10.0 Before then, it wasn't available; afterwards it was always available. --- lib/MongoDB.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/MongoDB.pm b/lib/MongoDB.pm index 8e993b0e..b7aca4e1 100644 --- a/lib/MongoDB.pm +++ b/lib/MongoDB.pm @@ -40,6 +40,12 @@ XSLoader::load(__PACKAGE__, $MongoDB::VERSION); *read_documents = \&MongoDB::BSON::decode_bson; +# regexp_pattern was unavailable before 5.10, had to be exported to load the +# function implementation on 5.10, and was automatically available in 5.10.1 +if ( $] eq '5.010' ) { + use re qw/regexp_pattern/; +} + 1;