Skip Menu |

This queue is for tickets about the Data-Walk CPAN distribution.

Report information
The Basics
Id: 47309
Status: resolved
Priority: 0/
Queue: Data-Walk

Owner: GUIDO [...]
Requestors: peter [...]

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)

Subject: Please localize $_
Download (untitled) / with headers
text/plain 263b
I got hit by using Data::Walk while $_ was aliased to an element of an array - thus mangling my array. To prevent this it would be nice if Data::Walk::walk() localized $_. This shouldn't change the documented interface. (File::Find documents $_ to be localized)
Download (untitled) / with headers
text/plain 116b
Hi, would the attached patch fix your problem? If not, can you send me a patch that works for you? Thanks, Guido
Index: lib/Data/ =================================================================== RCS file: /home/cvsroot/perl/Data-Walk/lib/Data/,v retrieving revision 1.16 diff -u -r1.16 --- lib/Data/ 24 Jun 2009 16:28:00 -0000 1.16 +++ lib/Data/ 24 Jun 2009 16:31:31 -0000 @@ -139,6 +139,8 @@ } } + local $_ = $_; + unless ($options->{bydepth}) { $_ = $item; $options->{wanted}->($item);
This patch seems to fix the issue.
Fixed. [master 896a9bf] localize $_ 1 file changed, 2 insertions(+)

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to