[PATCH xts] Drop use of perl's given/when construct
Peter Harris
pharris at opentext.com
Tue Mar 18 08:08:42 PDT 2014
The perl mongers have retroactively marked this construct
"experimental", five and a half years after it was marked stable.
http://perldoc.perl.org/perl5180delta.html#The-smartmatch-family-of-features-are-now-experimental
Signed-off-by: Peter Harris <pharris at opentext.com>
---
xts5/bin/xts-config.in | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/xts5/bin/xts-config.in b/xts5/bin/xts-config.in
index dbe84da..2dbe653 100755
--- a/xts5/bin/xts-config.in
+++ b/xts5/bin/xts-config.in
@@ -1,6 +1,5 @@
#!/usr/bin/perl -pi.bak
-use 5.10.0;
use warnings;
use strict;
use Sys::Hostname;
@@ -136,10 +135,16 @@ BEGIN
$::vars{"XT_PIXMAP_DEPTHS"} =~ s/,?\s+/ /g;
- given ($::vars{XT_DOES_BACKING_STORE})
+ if ($::vars{XT_DOES_BACKING_STORE} =~ /yes/i)
+ {
+ $::vars{XT_DOES_BACKING_STORE} = 2;
+ }
+ elsif ($::vars{XT_DOES_BACKING_STORE} =~ /no/i)
+ {
+ $::vars{XT_DOES_BACKING_STORE} = 1;
+ }
+ else
{
- $::vars{XT_DOES_BACKING_STORE} = 2 when (/yes/i);
- $::vars{XT_DOES_BACKING_STORE} = 1 when (/when/i);
$::vars{XT_DOES_BACKING_STORE} = 0;
}
--
1.9.0
More information about the xorg-devel
mailing list