In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/363879a0952f77ca92caac0ce999916648a45173?hp=0d66b88d99cbe219f6c39408ee83f70759b609b3>
- Log ----------------------------------------------------------------- commit 363879a0952f77ca92caac0ce999916648a45173 Author: Karl Williamson <[email protected]> Date: Wed Jun 15 14:32:14 2011 -0600 charnames: Quote metachars in script names "use charnames qw(.*)" will match any script; it should match none. ----------------------------------------------------------------------- Summary of changes: lib/charnames.pm | 4 ++-- lib/charnames.t | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/charnames.pm b/lib/charnames.pm index 23c53b7..020ab7c 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -2,7 +2,7 @@ package charnames; use strict; use warnings; use File::Spec; -our $VERSION = '1.19'; +our $VERSION = '1.21'; use bytes (); # for $bytes::hint_bits @@ -803,7 +803,7 @@ sub import # as tested for in # lookup_names $^H{charnames_short} = delete $h{':short'} || 0; - my @scripts = map uc, keys %h; + my @scripts = map { uc quotemeta } keys %h; ## ## If utf8? warnings are enabled, and some scripts were given, diff --git a/lib/charnames.t b/lib/charnames.t index 443738a..dc6487a 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -700,6 +700,10 @@ is("\N{U+1D0C5}", "\N{BYZANTINE MUSICAL SYMBOL FTHORA SKLIRON CHROMA VASIS}"); is($res, "foo-foo-1--2-3"); } +{ use charnames qw(.*); + ok (! defined charnames::vianame("a"), "Verify that metachars in script names get quoted"); +} + { # Test scoping. Outer block sets up some things; inner blocks # override them, and then see if get restored. -- Perl5 Master Repository
