[PATCH xts] Drop use of perl's given/when construct

Peter Hutterer peter.hutterer at who-t.net
Wed Mar 19 01:47:28 PDT 2014


On Tue, Mar 18, 2014 at 11:08:42AM -0400, Peter Harris wrote:
> 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>

Acked-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
   Peter

> ---
>  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
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list