Bug 3643: Add another regular expression to match new perl version output.
authorPat Downey <patd@symbian.org>
Tue, 31 Aug 2010 12:42:52 +0100
changeset 310 46889a3f0a06
parent 309 a265a2da5fcb
child 312 510bd35e96e2
Bug 3643: Add another regular expression to match new perl version output.
envinfo/envinfo.pl
--- 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
+}