projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b3ba608
)
sigtrap.pm: Avoid lexical $_
author
Father Chrysostomos
<sprout@cpan.org>
Tue, 4 Dec 2012 14:57:02 +0000
(06:57 -0800)
committer
Father Chrysostomos
<sprout@cpan.org>
Tue, 4 Dec 2012 18:51:21 +0000
(10:51 -0800)
my $_ is about to be deprecated.
It has been using it since commit
972fc2eb7a
to avoid modifying a
read-only argument. Using @{[...]} instead works, too.
lib/sigtrap.pm
patch
|
blob
|
history
diff --git
a/lib/sigtrap.pm
b/lib/sigtrap.pm
index
025845e
..
f10e3e1
100644
(file)
--- a/
lib/sigtrap.pm
+++ b/
lib/sigtrap.pm
@@
-95,8
+95,7
@@
sub handler_traceback {
# Now go for broke.
for ($i = 1; ($p,$f,$l,$s,$h,$w,$e,$r) = caller($i); $i++) {
@a = ();
- for my $fr (@args) {
- my $_ = $fr;
+ for (@{[@args]}) {
s/([\'\\])/\\$1/g;
s/([^\0]*)/'$1'/
unless /^(?: -?[\d.]+ | \*[\w:]* )$/x;