summaryrefslogtreecommitdiff
path: root/lib/charnames.pm
diff options
context:
space:
mode:
authorMarcel GrĂ¼nauer <marcel@codewerk.com>2004-06-22 16:43:50 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2004-06-22 21:23:59 +0000
commite5c3f8982a1650ad4c25a05c41a9038ce21a512c (patch)
treeff8c16f10c3e980f44ea399a0b326fd6b41cc3d5 /lib/charnames.pm
parent8ac28360b8ecd8e80ea061435399e96607e3a844 (diff)
downloadperl-e5c3f8982a1650ad4c25a05c41a9038ce21a512c.tar.gz
Proposed patch + test case.
Subject: [perl #30409] charnames.pm clobbers default variable From: Marcel "GrĂ¼nauer" (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.0.9-30409-91174.12.8617678524438@perl.org> p4raw-id: //depot/perl@22972
Diffstat (limited to 'lib/charnames.pm')
-rw-r--r--lib/charnames.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/charnames.pm b/lib/charnames.pm
index 4f7fdeb6ed..f0a4446b4d 100644
--- a/lib/charnames.pm
+++ b/lib/charnames.pm
@@ -190,8 +190,8 @@ sub import
## fill %h keys with our @_ args.
##
my ($promote, %h, @args) = (0);
- while (@_ and $_ = shift) {
- if ($_ eq ":alias") {
+ while (my $arg = shift) {
+ if ($arg eq ":alias") {
@_ or
croak ":alias needs an argument in charnames";
my $alias = shift;
@@ -210,11 +210,11 @@ sub import
alias_file ($alias);
next;
}
- if (m/^:/ and ! ($_ eq ":full" || $_ eq ":short")) {
- warn "unsupported special '$_' in charnames";
+ if (substr($arg, 0, 1) eq ':' and ! ($arg eq ":full" || $arg eq ":short")) {
+ warn "unsupported special '$arg' in charnames";
next;
}
- push @args, $_;
+ push @args, $arg;
}
@args == 0 && $promote and @args = (":full");
@h{@args} = (1) x @args;