This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44ac36f
)
t/re/regexp_unicode_prop.t: Drop dependency on given/when
author
Brian Fraser
<fraserbn@gmail.com>
Sat, 23 Mar 2013 20:45:10 +0000
(17:45 -0300)
committer
Karl Williamson
<public@khwilliamson.com>
Wed, 27 Mar 2013 03:06:52 +0000
(21:06 -0600)
t/re/regexp_unicode_prop.t
patch
|
blob
|
blame
|
history
diff --git
a/t/re/regexp_unicode_prop.t
b/t/re/regexp_unicode_prop.t
index
3e08afc
..
fb1b154
100644
(file)
--- a/
t/re/regexp_unicode_prop.t
+++ b/
t/re/regexp_unicode_prop.t
@@
-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 $@;