MediaWiki::DumpFile::FastPages3pm
Fastest way to parse a page dump file
Usage
use MediaWiki::DumpFile::FastPages;$pages = MediaWiki::DumpFile::FastPages->new($file);$pages = MediaWiki::DumpFile::FastPages->new(\*FH);while(($title, $text) = $pages->next) {print "Title: $title\n";print "Text: $text\n";}
About
This is a subclass of MediaWiki::DumpFile::Pages that configures it to run in fast mode and uses a custom iterator that dispenses with the duck-typed MediaWiki::DumpFile::Pages::Page object that fast mode uses giving a slight processing speed boost.
See the MediaWiki::DumpFile::Pages documentation for information about fast mode.
Methods
All of the methods of MediaWiki::DumpFile::Pages are also available on this subclass.
new
This is the constructor for this package. It is called with a single parameter: the location of a MediaWiki pages dump file or a reference to an already open file handle.
next
Returns a two element list where the first element is the article title and the second element is the article text. Returns an empty list when there are no more pages available.
Copyright & license
Copyright 2009 "Tyler Riddle".
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
Releases
5 releases since Debian 9 (Stretch); the text changed 2 times.