t/re/regexp_unicode_prop.t: Drop dependency on given/when
authorBrian Fraser <fraserbn@gmail.com>
Sat, 23 Mar 2013 20:45:10 +0000 (17:45 -0300)
committerKarl Williamson <public@khwilliamson.com>
Wed, 27 Mar 2013 03:06:52 +0000 (21:06 -0600)
t/re/regexp_unicode_prop.t

index 3e08afc..fb1b154 100644 (file)
@@ -188,19 +188,17 @@ sub match {
 
     my ($str, $name);
 
-    given ($char) {
-        when (/^\\/) {
-            $str  = eval qq ["$char"];
-            $name =      qq ["$char"];
-        }
-        when (/^0x([0-9A-Fa-f]+)$/) {
-            $str  =  chr hex $1;
-            $name = "chr ($char)";
-        }
-        default {
-            $str  =      $char;
-            $name = qq ["$char"];
-        }
+    if ($char =~ /^\\/) {
+        $str  = eval qq ["$char"];
+        $name =      qq ["$char"];
+    }
+    elsif ($char =~ /^0x([0-9A-Fa-f]+)$/) {
+        $str  =  chr hex $1;
+        $name = "chr ($char)";
+    }
+    else {
+        $str  =      $char;
+        $name = qq ["$char"];
     }
 
     undef $@;