rafl/search-dict — pull request #1 by eserte (2012-03-31 08:21:58+00:00)
Title: Make more filehandle types usable with Search::Dict

Search::Dict operates on filehandles but unfortunately for getting the file size it is using a stat() call. This means that Search::Dict cannot use special filehandles like tied handles, or handles originating from a scalar open. I fixed this by doing a fallback to seek() if the stat() call fails, so Search::Dict should work now on all seekable filehandles.

One remaining problem: make test shows an "stat() on unopened filehandle $strfh" warning when running on a perl < 5.15.x. It seems that perl-5.15.8 (at least) fixed this problem. One could cease this putting the problematic stat() call into a "no warnings" block, but then the code wouldn't be perl 5.000 compatible anymore.