#!/usr/bin/perl use strict; use warnings; use encoding 'utf8'; # รค use CMS::MediaWiki; my $user = 'user'; my $password = 'pw'; my $host = 'localhost'; my $path = 'mediawiki'; my $mw = CMS::MediaWiki->new( host => $host, path => $path, debug => 2, ); my $error_code = $mw->login( user => $user, pass => $password, ); if ($error_code) { print STDERR "error: '$error_code'\n"; } my $lines_ref = $mw->getPage(title => 'Hauptseite'); foreach my $line (@$lines_ref) { print "$line\n"; }