#!/usr/bin/perl use warnings; use strict; use MediaWiki::API; my $mw = MediaWiki::API->new(); $mw->{config}->{api_url} = 'http://ma22-wiki-001/eblwiki/api.php'; # log in to the wiki $mw->login( { lgname => 'user', lgpassword => 'xxxxxx' } ) || die $mw->{error}->{code} . ': ' . $mw->{error}->{details}; # get a list of articles in category my $articles = $mw->list ( { action => 'query', list => 'categorymembers', cmtitle => 'Category:Perl', cmlimit => 'max' } ) || die $mw->{error}->{code} . ': ' . $mw->{error}->{details}; # and print the article titles foreach (@{$articles}) { print "$_->{title}\n"; }