Bug 3643: Add another regular expression to match new perl version output.
--- a/envinfo/envinfo.pl Fri Aug 27 15:38:43 2010 +0100
+++ b/envinfo/envinfo.pl Tue Aug 31 12:42:52 2010 +0100
@@ -144,7 +144,20 @@
# Perl
my $perl_ver = 'N.A.';
my $perl_out = `perl -v`;
-$perl_ver = $1 if ($perl_out =~ /This is perl, v(\S+)/m);
+
+# match:
+#match This is perl, v5.10.0 built for darwin-thread-multi-2level
+if($perl_out =~ /This is perl, v(\S+)/m)
+{
+ $perl_ver = $1;
+}
+# match:
+# This is perl 5, version 12, subversion 1 (v5.12.1) built for MSWin32-x64-multi-thread
+elsif($perl_out =~ /This is perl.*? \(v(\S+)\)/m)
+{
+ $perl_ver = $1;
+}
+
push @environment_info, {name=>'Perl', version=>$perl_ver};
# Python
@@ -338,4 +351,4 @@
{
warn "WARNING: Could not write to file: $output\n";
}
-}
\ No newline at end of file
+}