Thanks for the great feature request! This is perfect for the upcoming 1.0. I'll work to get
this integrated and released soon. I also really appreciate the patch and tests.
Take care,
Tyler Riddle
On Tue Oct 06 03:39:58 2009, DVWRIGHT wrote:
Show quoted text> Parse::MediaWikiDump::Revisions has support to open regular filehandles
> but does not handle object (blessed) filehandle streams.
>
> bz2 is a very common filetype for MediaWiki Dumps, the defacto (?)
> way to handle these in perl is with IO::Uncompress::Bunzip2.
>
> Currently, passing a filehandle from IO::Uncompress::Bunzip2 to
> Parse::MediaWikiDump
> results in:
> could not open IO::Uncompress::Bunzip2=GLOB(0xa3695e0): No such file or
> directory at lib/Parse/MediaWikiDump/Revisions.pm line 129.
>
>
> Desired result:
> Parse::MediaWikiDump transparently handles gz and bz2 files as it does
> 'regular'
> files and filehandles.
>
> The fix is trivial, add
> use Scalar::Util qw(reftype);
> and change
> line 124: if (ref($source) eq 'GLOB') {
> to
> line 124: if (reftype($source) && reftype($source) eq 'GLOB') {
> lib/Parse/MediaWikiDump/Revisions.pm
>
> I am including a diff of Revisions.pm and a diff of pages.t (I added a
> test) as well as a diff for Build.PL (as well as 2 compressed test files)
>