Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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 :)


Comment on Re: Offline wikipedia using Perl
Re^2: Offline wikipedia using Perl
by grondilu (Pilgrim) 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.

Re^2: Offline wikipedia using Perl
by toolic (Chancellor) 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.).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2014-09-23 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls