Skip Menu |

This queue is for tickets about the File-Locate CPAN distribution.

Report information
The Basics
Id: 70493
Status: new
Priority: 0/
Queue: File-Locate

Owner: Nobody in particular
Requestors: user42 [...]

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

Subject: coderef from magic scalar
Date: Fri, 26 Aug 2011 11:00:02 +1000
To: bug-File-Locate [...]
From: Kevin Ryde <user42 [...]>
Download (untitled) / with headers
text/plain 318b
In File::Locate 0.62 on recent i386 debian perl 5.12.4, locate() doesn't notice a callback coderef if it comes from a tied scalar. below prints nothing, where I expect it to reach the my_func() and print. I suspect locate() should run SvGETMAGIC() or whatever equivalent before checking SvROK for a coderef.
text/x-perl 371b
use strict; use File::Locate; { package MyTie; sub TIESCALAR { my $class = shift; return bless {@_}, $class; } sub FETCH { return \&my_func; } sub my_func { my ($filename) = @_; print "my_code: $_\n"; exit 0; } } my $coderef; tie $coderef, 'MyTie'; # print $coderef,"\n"; locate ("*.pm", "/var/cache/locate/locatedb", $coderef);

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

Please report any issues with to