Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Offline wikipedia using Perl

by wazoox (Prior)
on Mar 09, 2012 at 18:09 UTC ( #958769=note: print w/replies, xml ) Need Help??

in reply to Offline wikipedia using Perl

This looks nice, but I don't really get how it must be used, I suppose I should check your wikipedia page for the missing parts :)

Just a couple of proposed enhancements :

  • as you're using "warnings", there is not point calling "perl -w"
  • you don't check for errors when opening files and writing. This is worse than a crime, a fault :)

Replies are listed 'Best First'.
Re^2: Offline wikipedia using Perl
by toolic (Bishop) on Mar 10, 2012 at 13:33 UTC
    as you're using "warnings", there is not point calling "perl -w"
    There is a difference, from perldoc warnings:
    The warnings pragma is a replacement for the command line flag -w , but the pragma is limited to the enclosing block, while the flag is global. See perllexwarn for more information.
    -w does everything warnings does, not the other way around. That being said, it is unlikely the OP wants to enable warnings for use'd modules (XML::Parser, etc.).
Re^2: Offline wikipedia using Perl
by grondilu (Friar) on Mar 10, 2012 at 10:00 UTC

    Once the database has been built, it is supposed to be used with a CGI script and a local webserver. The CGI script is on the wikipedia page indeed, but it is kind of ugly so I didn't post it here as I am not much proud of it :) A CGI is easy to write anyway. Notice that it requires Text::Mediawiki in order to turn wiki format into HTML.

    As for checking errors during file openings and writings, I'll try to correct this.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://958769]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2023-03-21 18:43 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.